Running a saved query - hidden

M

-Michelle-

Hi
Using A2003

I want to run a saved query (called eg: qryMyQuery) from code, but I don't
want the results to be visible.

What is a good way to do this?

In comparison to what I'm trying to do, is it more efficient (ie: overhead,
speed, etc) to run the query writing the sql and then doing the Docmd.RunSQL
MySqlStr?

TIA
Michelle

**Please post replies to newsgroup**
 
R

Rick Brandt

-Michelle- said:
Hi
Using A2003

I want to run a saved query (called eg: qryMyQuery) from code, but I don't
want the results to be visible.

What is a good way to do this?

In comparison to what I'm trying to do, is it more efficient (ie: overhead,
speed, etc) to run the query writing the sql and then doing the Docmd.RunSQL
MySqlStr?

If this is an action query (update, delete, or append) then "running it"
does not involve anything being displayed on your screen. Just use...

CurrentDB.Execute "QueryName", dbFailOnError

....in a VBA code procedure. This is better than any of the DoCmd options
as it doesn't produce confirmations prompts which you would have to
suppress using DoCmd.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top