Updating criteria of query with VBA

mdlueck

Sr. Application Developer
Local time
Today, 01:44
Joined
Jun 23, 2011
Messages
2,650
Yesterday I came across a very slick solution to open a query object within the Access database, modify the Criteria of certain colums, execute it, then refresh the UI so that the UI would show the updated query results.

Specifically this was not a "SQL in the VBA source code" type solution.

Unfortunately that page is not in my browser history for yesterday, and I did not happen to bookmark that page.

I have not been able to locate something similar in the Access 2007 online help. Nothing along the lines of "opening an existing query already in the database and updating the Criteria for various columns".

Suggestions of what I saw?
 
Last edited:
Look/google for QueryDef

A saved query is a QueryDef in the collection of QueryDefs. It has a property qdf.SQL , where the SQL string can be read from, modified, and put back in again.
 

Users who are viewing this thread

Back
Top Bottom