hide the results of a query

  • Thread starter Thread starter gls858
  • Start date Start date
G

gls858

I have a series of queries that run from a command button
using DoCmd.OpenQuery. These queries are used in a report.
Is there any way to keep the select queries from displaying
and just display the report?

gls858
 
You do not need to run the query before you run the report. Just run the
report; it'll call and run the queries that it needs automatically.
 
I'm not sure I understand...
The query for the report should be indicated in the RecordSource of the
report, and it never "shows." It derives the records according to the
criteria of the query, and passes them on to the report. The report opens
without ever displaying the query itself... just on the records on the
report.
Al Camp
 
I have a series of queries that run from a command button
using DoCmd.OpenQuery. These queries are used in a report.
Is there any way to keep the select queries from displaying
and just display the report?

gls858

If the Report's Recordsource is the query (or queries), just open the
Report. There's no need to use OpenQuery at all.

John W. Vinson[MVP]
 
John said:
If the Report's Recordsource is the query (or queries), just open the
Report. There's no need to use OpenQuery at all.

John W. Vinson[MVP]
Ahh that's what I get for copying code. The code I copied was for make
table queries. So it would stand to reason that they would have to run
before the report. I'll just remove the select queries.
Thanks for the help.

gls858
 
Al said:
I'm not sure I understand...
The query for the report should be indicated in the RecordSource of the
report, and it never "shows." It derives the records according to the
criteria of the query, and passes them on to the report. The report opens
without ever displaying the query itself... just on the records on the
report.
Al Camp
The reason you didn't understand was because it was a stupid
question :-) I was recycling someone else's code and I really
don't know VB, so I was just putting in the lines with the names
changed to protect the innocent hoping for the right outcome.

You,Ken and John got me straightened out. Thanks. Amazing how
you can block out the obvious looking for a solution.
 
Ahh that's what I get for copying code.

<g> BT,DT. Sometimes even my own code.

At times it's easier to begin from scratch than to adapt something
existing!

John W. Vinson[MVP]
 
Back
Top