docmd.runsql only works with an action query how do I view a SELECT query

tc3of4

Registered User.
Local time
Today, 20:53
Joined
Jan 18, 2001
Messages
32
docmd.runsql only works with an action query how do I view a SELECT query

tc3of4
 
Docmd.OpenQuery "TheQueryName", acViewNormal

Where it says acViewNormal, you can also use acViewDesign or acViewPreview and you can set the edit mode to Add or ReadOnly or Edit (default is Edit) after the acViewNormal (example: acViewNormal, ReadOnly )

BL
hth
 
I guess I should have put more information
I've written dynamic queries through code.
but they are SELECT queries and the docmd.runsql will only run ACTION queries.

So how do I view the results of a SELECT query (that was created through code)

thanks
tc3of4
 
Save your sql as a QueryDef and then run it with OpenQuery.
 

Users who are viewing this thread

Back
Top Bottom