Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Report Wxecutes Query in SubReport???

Status
Not open for further replies.

Rick4077

Technical User
Oct 19, 2004
149
US
I have a report that has a SubReport placed under the report footer based on an SQL query.

I wish to open the report, have the query run and then view the report, but NOT print it. (the SQL query runs automatically, right?)

Something like . . .

DoCmd.OpenReport,acViewPreview . . .

But this isn't working.

Where have I gone wrong?

Thanks . . .

 
Have you tried:
DoCmd.OpenReport "TheNameOfYourReport", acViewPreview

Most of these commands can be viewed through intellisense. For example, type
DoCmd.OpenReport
Followed by a space and see what happens.
 
Hey that works!

I had . . .

DoCmd.OpenQuery "qryReportsProgram"
DoCmd.OpenReport "rpSCMLS_report", acViewReport

Do I need to run the Query first if it is a subform in the report? I'm suspecting that if I run the report the query will automatically execute at the same time, correct?

. . . "Most of these commands can be viewed through intellisense. For example, type
DoCmd.OpenReport . . ." This looks kewl!

Have to try it.

Thanks much . . . Rick



 
If the subreport is based on a query, the query will run when you open the report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top