By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,649 Members | 1,662 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,649 IT Pros & Developers. It's quick & easy.

Supress Results of a Select Query

100+
P: 132
Hello All,

I have a report that is tied to a SELECT query.....Problem is, when I open the report, it also opens the results of the select query. Is there a way to supress the Query from displaying the reults???

DoCmd.openquery "qryETS Open orders", (WHAT GOES HERE?)
Feb 27 '08 #1
Share this Question
Share on Google+
6 Replies


cori25
P: 83
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False
  2. DoCmd.OpenQuery "query"
  3. DoCmd.SetWarnings True
Feb 27 '08 #2

JKing
Expert 100+
P: 1,206
If your report is based off the query there should be no need to open the query at all.

Could you post the rest of the code you are using? Try to elaborate a little more on what you are trying to accomplish so we can create the best fit solution for you.

For example are you opening the query because you need to manipulate it before executing the report?
Feb 27 '08 #3

JKing
Expert 100+
P: 1,206
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False
  2. DoCmd.OpenQuery "query"
  3. DoCmd.SetWarnings True
The query will still open. The SetWarnings command only suppresses the prompts that accompany action queries such as updates, inserts or deletes.
Feb 27 '08 #4

cori25
P: 83
Hello....

I am aware of whatthe SetWarnings command does, but, from what was explained it is hard to determine what exactly is being asked.

Thanks
Feb 27 '08 #5

100+
P: 132
Hello....

I am aware of whatthe SetWarnings command does, but, from what was explained it is hard to determine what exactly is being asked.

Thanks

"If your report is based off the query there should be no need to open the query at all." I was unaware of this.....I thought I needed to run the query first in order to update the information.....I removed the DoCmd.openquery and it seems to be working....

By the way, I had the turn warnings on and off in the code but that does NOT supress the results of the query from being dislayed.
Feb 27 '08 #6

cori25
P: 83
Hello!

If it is a select query updating the report, then no, you do not need to run it.

Sorry for the confusion!

Thanks
Feb 27 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.