I have a variable that I have read into a global variable. I now want to use that variable in the criteria of a Query SQL statement. How do I accomplish this task?
pcdaveh,
The bimmer solution works well, but if you don't want to use globals, which can be dangerous, you'll have to just dynamically alter the sql of the query. Ie, if you had a static query, meaning all the same select fields and joins were not going to change, you could just get the sql from the querydef in code, use Instr() to find the Where clause, trunc the sql at that spot, then add your where clause using the variable local to the procedure you're in, and reset the querydefs.sql to the new sql
--Jim
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.