MacWT
02-22-2000, 02:25 AM
Opening a report from a Form, I can Print it immediatly and I can open it in Preview or in Design mode. I would like to print it, but not before showing me the Print Dialog Box, so I can change the number of copies to any number I want. How do I do this?
Or do you have another method that lets me print any given number of copies of a report?
[This message has been edited by MacWT (edited 02-22-2000).]
lnoles
02-22-2000, 08:06 AM
Click on File in the menu, then click on Print. This should bring up the dialog box...
MacWT
02-22-2000, 10:36 PM
Thanks for the reply. I was looking for a way to do this in one click. I don't want to confuse my collegues who have to work with this.
Add this line after the code that opens the report in preview mode:
DoCmd.RunCommand acCmdPrint
MacWT
02-28-2000, 01:41 AM
Thanks, that solved my problem.
belsha
01-28-2004, 04:44 AM
I added Neals code, but the dialog box opens on top of the print preview of the report, and if you hit close for the print dialog box, you can see the preview but get an error referring to closing the dialog box. This code is
stDocName = "rptMeetingAttendance"
DoCmd.OpenReport stDocName, acPreview
DoCmd.Maximize
DoCmd.RunCommand acCmdPrint
Would like the print preview to show, THEN the dialog box. Any suggestions?
richardplr
01-28-2004, 05:00 PM
Originally posted by Neal
Add this line after the code that opens the report in preview mode:
DoCmd.RunCommand acCmdPrint
Hi
I have followed the above command on my print report but how come it give me a blank preview after that then show me the print dialog and if I press OK, then it show me the report preview.
My command as follows. Did I do anything wrong.
Please help. Thks
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click
Dim stDocName As String
stDocName = "Purchase Contract (Oversea)"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdPrint
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
richardplr
01-29-2004, 09:23 PM
Originally posted by richardplr
Hi
I have followed the above command on my print report but how come it give me a blank preview after that then show me the print dialog and if I press OK, then it show me the report preview.
My command as follows. Did I do anything wrong.
Please help. Thks
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click
Dim stDocName As String
stDocName = "Purchase Contract (Oversea)"
DoCmd.OpenReport stDocName, acPreview
DoCmd.RunCommand acCmdPrint
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub