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.