When you print a report manually, you have the opportunity to specify the number of copies in the Print dialog box. Automating the process is simple too — just execute the PrintOut method as follows:
DoCmd.PrintOut printrange, pagefrom, pageto, printquality, copies, collatecopiesAs you can see, the fifth argument is copies; specify the number of copies using this argument. For instance, the following statement opens and prints four copies of a report named Invoices:
DoCmd.OpenReport "Invoices", acViewPreview
DoCmd.PrintOut , , , , 4If the report is already open, make sure it's current before printing, as follows:
DoCmd.SelectObject acReport, "Invoices", True
DoCmd.PrintOut , , , , 4If you want to print only one copy, you can do so immediately from the OpenReport method by changing acViewPreview to acViewNormal, as follows:
DoCmd.OpenReport "Invoices", acViewNormalThis statement will send the Invoices report directly to the printer. If users need more flexibility, create a print form that captures page numbers and copy count and pass those values to the report via the OpenReport method.
Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.