2 hours
ago: Doing some maintenance on the server today. If you've placed an order and it hasn't processed yet, hang in there. Should be ready soon. I've got the car up on the jack and the tires are off...
Dismiss
I created a report that executes 3 SQL queries (DoCmd.OpenQuery) in order to produce the report. For this particular report, whenever I run it, the tabs for the 3 queries I used appear with the report print preview. There must be a VBA setting that suppresses these tabs, but I have been unable to find it. Any suggestions?
Adam Schwanz
@Reply 4 years ago
Are they just normal select queries? Why do they need to be opened at all if so?
You could just close them with docmd.close after you open the report and have the information you need for them in the report.
Kevin Yip
@Reply 4 years ago
That is what DoCmd.OpenQuery is designed to do: it opens up a query window the same way you open it from the navigation pane. To open queries "silently," you need to open them as recordsets in VBA. E.g.:
Dim r As Recordset
Set r = CurrentDb.OpenRecordset("MyQueryNameHere")
For action queries, execute them using the Execute method:
CurrentDb.Execute "MyActionQueryName"
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Forum.