Recommendation: Since your reports may change number of requested copies give the user the option of select number of copies instead of hardcoding the value.
Here an article which I have used in the past.
Make Print Dialog Box appear when printing a Report
Open the Report in acPreview with your code ... don't worry, it will not appear on screen if you follow the instructions below.
Add the following to the "On Activate" event of the report.
This will cause the Print Dialog Box to open so you can choose a printer, and also choose the number of copies .... ect.
After you make the choices in the Printer Dialog Box the report will print ... but the code will close the report without it ever appearing on screen.
There is also code here in case the result of the recordset returns "no records" so there's no need to use the On No Data event. It will display a message box that you can alter to fit your needs.
code:--------------------------------------------------------------------------------Private Sub Report_Activate()On Error GoTo Err_Report_ActivateDim strMsg As StringDim strTitle As StringstrMsg = "The Were No Records Returned." & vbCrLf & _ "Print has been Canceled."strTitle = " No Records Returned" If Me.Report.HasData Then DoCmd.RunCommand acCmdPrint DoCmd.Close acReport, Me.NameElse MsgBox strMsg, vbInformation + vbOKOnly, strTitle DoCmd.Close acReport, Me.NameEnd If Err_Report_Activate: Resume Next DoCmd.Close acReport, Me.Name End Sub
--------------------------------------------------------------------------------
--------------------
Ricky Hicks
Birmingham, Alabama USA
go can also build your own macro using the docmd.printout
|