Call an Access query in a Module

WSC

Registered User.
Local time
Today, 01:33
Joined
Nov 16, 2006
Messages
19
I would like to call a query that is stored in my database from inside a module that runs on database start up. Can someone please give me the syntax?
 
Code:
DoCmd.OpenQuery "YourQueryNameHere"

You can also tell it whether it is read only (look up OpenQuery in the help file for more info on the syntax)
 
depends what type of query and the purpose is. i can think of a few scenrios.
you can use a QueryDef to run a query or a docmd.runsql to run some sql.

sam
 
Good point Sam - But, since they had mentioned that it was
a query that is stored in my database
I assumed that they were talking about a pre-built query that is saved under the queries.
 

Users who are viewing this thread

Back
Top Bottom