Fred, below is a sample of the code you assisted me the PrintOut Method.Dim
stDocName As String
DoCmd.RunCommand acCmdSaveRecord
Dim Message, Title, Default, PrintCopies
Message = "Enter Number of Copies" ' Set prompt.
Title = "Print Operator Daily Call Sheet" ' Set title.
PrintCopies = InputBox(Message, Title) ', Default)
stDocName = "rptOperatorDailyCallSheet-2"
DoCmd.OpenReport stDocName, acPrint
DoCmd.PrintOut , , , , PrintCopies, ' 0 ' 0=not collated
The PrintOut method is printing the report and form on the screen.
It is print one copy of the report and additional copies of the screen form.
For example. Copy input is (3) 1 copy of the report and 2 copies of the
screen form.
What adjustments need to be made.
If you Dim variables, you should also set their types, otherwise they
are all going to be Variant.
You had incorrect parenthesis within the InputBox function.
You had the Collate argument within single quotes which would make it
a string. It must be a number.
If you just wish to print the report, there is no need to open it in
preview.
Dim stDocName As String
Dim strMessage as String, strTitle as String
Dim intDefault as Integer, intPrintCopies as Integer
intDefault = 1 ' You do want at least one copy printed, don't you?
strMessage = "Enter Number of Copies" ' Set prompt.
strTitle = "Print Operator Daily Call Sheet" ' Set title.
intPrintCopies = InputBox(Message, Title, Default)
stDocName = "rptOperatorDailyCallSheet-2"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SelectObject acReport, stDocName, True
DoCmd.PrintOut acPrintAll, , , , intPrintCopies, 0
The whole procedure can be shortened to the following:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SelectObject acReport, "rptOperatorDailyCallSheet-2"
DoCmd.PrintOut acPrintAll, , , , InputBox("Enter Number of Copies", _
"Print Operator Daily Call Sheet",1), 0
Look up the SelectObject in VBA help.