View Full Version : docmd.runsql only works with an action query how do I view a SELECT query


tc3of4
05-02-2002, 12:00 PM
docmd.runsql only works with an action query how do I view a SELECT query

tc3of4

boblarson
05-02-2002, 03:51 PM
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

tc3of4
05-03-2002, 07:00 AM
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

David R
05-03-2002, 07:44 AM
Save your sql as a QueryDef and then run it with OpenQuery.