Print Multiple copies

J

jwr

Can I set the default on a report or form to print more than one copy
without going to the print screen and changing copies from 1 to the number I
want printed each time?

Thanks
 
F

fredg

Can I set the default on a report or form to print more than one copy
without going to the print screen and changing copies from 1 to the number I
want printed each time?

Thanks

Look up the SelectObject and PrintOut methods in VBA help.

You could set the DefaultValue of an unbound text control on a form to
indicate how many copies you want to print. You could then always
overwrite that number if wanted.
You would use DoCmd.SelectObject to select the report and then
DoCmd.PrintOut to indicate the number of copies.

To print a report without opening it in Preview:

DoCmd.SelectObject acReport, "ReportName, True
DoCmd.PrintOut , , , , forms!Formname!ControlName
 
J

jwr

I am not very knowledgeable with VBA coding.

You said to print a report without opening it in Preview:
DoCmd.SelectObject acReport, "ReportName, True
DoCmd.PrintOut , , , , forms!Formname!ControlName

Where would I put this information: on click, on open, on close, etc.?

I am assuming where you have "ReportName,True that if would put, for
instance, "Authorization to Deliver, True???

Where would I put the number of copies needed?
Formname!ControlName?? What do you mean here?

Sorry for my dumb questions and ignorance.
Thanks
 
F

fredg

I am not very knowledgeable with VBA coding.

You said to print a report without opening it in Preview:


Where would I put this information: on click, on open, on close, etc.?

I am assuming where you have "ReportName,True that if would put, for
instance, "Authorization to Deliver, True???

Where would I put the number of copies needed?
Formname!ControlName?? What do you mean here?

Sorry for my dumb questions and ignorance.
Thanks

1) Either create a new form or add an unbound text control to an
existing form. Name the control "CopiesToPrint".

2)Add a command button to you form. Name the button "PrintReport".

3) Code this command button's Click event:
DoCmd.SelectObject acReport, "TheReportName", True
DoCmd.PrintOut , , , , Me![CopiesToPrint]

Change "TheReportName" to what ever the actual name of your report is.

I just noticed I left off a quote in my original reply.
"ReportName, . Surround the report name in quotes, i.e. "ReportName",.

The above code will print the report without you having to actually
open it (that's what the True argument means).
If you will have already opened the report (in preview) then change
True to False. (You really should have read this in VBA help. It's
quite clear, as is the information on the PrintOut method.)

I've changed the code a bit from what I originally posted. The
Me![CopiesToPrint] replaces my original forms!Formname!ControlName. It
means the same as long as the code is placed on the same form as the
control. Please also read VBA help on the Me keyword.

When the user enters the number of copies to print in that unbound
control and then clicks the command button, the report will print that
number of copies.
 

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

Top