Run query, send to report and then close query

shabbaranks

Registered User.
Local time
Today, 12:37
Joined
Oct 17, 2011
Messages
300
Hi - yep me again!!

Im trying to do 2 things - learn some VBA and get my query to output to the report and close the query in the background. I can get the first bit going but it continues to leave the query open my code is:
Code:
Private Sub ReprintTimeSheet_Click()
DoCmd.OpenQuery "RePrintTimesheetQuery"
DoCmd.OpenReport "RePrintTimesheetReport"
End Sub

Thanks
 
Why not just set the report's RecordSource as being the query?
 
Simple when you know how - thanks worked a treat :)
 

Users who are viewing this thread

Back
Top Bottom