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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running multiple reports from one command button

Status
Not open for further replies.

missinglinq

Programmer
Feb 9, 2002
1,914
US
Sorry, search function here is still down for maintenance! I'm finishing up a small app and the users request that rather than have a separate command button to print each report that a single button be used to print all monthlies. I seem to remember reading that a DoEvents needs to be inserted between calling each report in order for Access to complete printing one before starting to print the next, something like

Code:
DoCmd.OpenReport "FirstReport", acNormal
DoEvents
DoCmd.OpenReport "SecondReport", acNormal
DoEvents
DoCmd.OpenReport "ThirdReport", acNormal
DoEvents

Did I remember this correctly?

Is the final DoEvents before returning control to the form necessary?

Is there any downside to this? This is going to be used on a very simple system where there won't be any multi-tasking going on to "hijack" the system during the DoEvents break.

Thanks in advance!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
I use the following:
Code:
DoCmd.OpenReport "CARpt", acPreview 'open report
DoCmd.SelectObject acReport, "CARpt" 'select
DoCmd.PrintOut , , , , 3 'print number of copies
DoCmd.Close acReport, "CARpt" 'close report
DoCmd.OpenReport "ExecRpt", acPreview 'open report
DoCmd.SelectObject acReport, "ExecRpt" 'select
DoCmd.PrintOut , , , , 4 'print number of copies
DoCmd.Close acReport, "ExecRpt" 'close report
DoCmd.OpenReport "Ver2ARpt", acPreview 'open report
DoCmd.SelectObject acReport, "Ver2ARpt" 'select
DoCmd.PrintOut , , , , 3 'print number of copies
DoCmd.Close acReport, "Ver2ARpt" 'close report
DoCmd.OpenReport "Ver2Rpt", acPreview 'open report
DoCmd.SelectObject acReport, "Ver2Rpt" 'select
DoCmd.PrintOut , , , , 2 'print number of copies
DoCmd.Close acReport, "Ver2Rpt" 'close report
Opening each report in turn, selecting and printing the desired number of copies and closing before opening the next.

Let them hate - so long as they fear... Lucius Accius
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top