Syntax for number of copies to print?

  • Thread starter Thread starter Chris Freeman
  • Start date Start date
C

Chris Freeman

Is there a proper syntax for setting the number of copies to print of a
report? Currently I simply have:

DoCmd.OpenReport stDocName, acViewPreview
With Reports(stDocName).Printer
.Copies = 2
End With

This opens the report but nothing. then I tried:

DoCmd.OpenReport stDocName, acViewPreview
Reports(stDocName).PrintCount = 2

And this returns an error message: "This property is read-only and cannot be
set"

What I looking for is something where the user click the button and the
report prints the number of prints automatically, like this:

DoCmd.OpenReport stDocName, acNormal, Copies:= X
where X = number entered on a form in case someone needs to change the print
number.

Thanks in advance
 
Is there a proper syntax for setting the number of copies to print of a
report? Currently I simply have:

DoCmd.OpenReport stDocName, acViewPreview
With Reports(stDocName).Printer
.Copies = 2
End With

This opens the report but nothing. then I tried:

DoCmd.OpenReport stDocName, acViewPreview
Reports(stDocName).PrintCount = 2

And this returns an error message: "This property is read-only and cannot be
set"

What I looking for is something where the user click the button and the
report prints the number of prints automatically, like this:

DoCmd.OpenReport stDocName, acNormal, Copies:= X
where X = number entered on a form in case someone needs to change the print
number.

Thanks in advance

Look up the SelectObject and the PrintOut methods in VBA help.

No need to open the report in Preview if you know you're going to
print it out.

DoCmd.SelectObject acReport, "ReportName", True
DoCmd.PrintOut acPrintAll, , , , 2
 
Back
Top