It would have been easier to explain the below if you had been more
specific with routine names...
If the routines creating the SQL statements are Subs, convert them to
Functions that return a string value. Then, in the calling routine,
use the appropriate function and pass the resulting string. Something
like:
function SQL1(...) as string
...
function SQL2(...) as string
...
function SQL3(...) as string
...
sub CalledSub (SQLStatement as string)
...
sub MainControl()
...
calledsub choose (i, SQL1(), SQL2(), SQL3())
...
--
Regards,
Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions