You can dynamically change the SQL of a query.
'Open the query as a QueryDef
dim qdf as querydef
set qdf = currentdb.QueryDefs("YourQueryName")
qdf.sql = left(qdf.sql, instr(qdf.sql, _
" WHERE ")-1 & " WHERE " & txtYourNewCriteria
qdf.close
Just make sure that...
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.