Print dialog box in VBA

  • Thread starter Thread starter chad
  • Start date Start date
Where do I insert this? I have the code so far...

Dim stDocName As String

stDocName = "Report 1"
DoCmd.OpenReport "Report 1", acViewNormal
So where do I put the DoCmd.RunCommand acCmdPrint. If I
put it before or after, it gives me an error....

Thanks for the help so far
 
Open the report in preview mode first

Dim stDocName As String
stDocName = "Report 1"
DoCmd.OpenReport "Report 1", acViewPreview
On Error Resume Next '2501 error occurs when you hit cancel
DoCmd.RunCommand acCmdPrint
 
One last question
I have about 19 reports to print, and I was trying to set
it up so that they all printed off one button. Is there
anyway to set the print setting without previewing each
report.
 
Back
Top