Printout Command, dispaly printer options

wtrimble

Registered User.
Local time
Today, 11:51
Joined
Nov 13, 2009
Messages
177
Using the Printout Command, I can't find a way to have the Print Dialog Box open up before the form prints, it automatically prints out of the default printer. I want the user to be able to choose the printer and any options of their choice. Is there way to have it come up??

Thanks for any help
 
how about this

DoCmd.OpenReport "yourreportname", acViewPreview, ,
DoCmd.RunCommand acCmdPrint
 
Last edited:
Code:
Private Sub YourButton_Click()
Dim stDocName As String
stDocName = "yourReportname"
DoCmd.OpenReport "yourReportname", acViewPreview
On Error Resume Next [COLOR=seagreen][B]' If you cancel printing and generate error 2501[/B][/COLOR]
DoCmd.RunCommand acCmdPrint
End Sub
 
Code:
Private Sub YourButton_Click()
Dim stDocName As String
stDocName = "yourReportname"
DoCmd.OpenReport "yourReportname", acViewPreview
[COLOR="Red"][B]On Error Resume Next [COLOR=seagreen][B]' If you cancel printing and generate error 2501[/B][/COLOR][/B][/COLOR]
DoCmd.RunCommand acCmdPrint
End Sub

IMO: You should trap for the 2501 error instead of ignoring all runtime errors.
 

Users who are viewing this thread

Back
Top Bottom