Syntax for number of copies to print?

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
 
F

fredg

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top