Reputation: 125
I have this macro built in Access 2010 which will open a report and prompt for a printer selection. I have it defaulted in the report so I want to skip the printer prompt but can't figure out how to do it.
Function OpenReport()
On Error GoTo OpenReport_Err
DoCmd.OpenReport "Results", acViewReport, "", "", acNormal
DoCmd.RunCommand acCmdPrintPreview
DoCmd.RunCommand acCmdPrintSelection
DoCmd.RunCommand acCmdCloseDatabase
OpenReport_Exit: Exit Function
OpenReport_Err: MsgBox Error$ Resume OpenReport_Exit
End Function
In 2007 there was a print option that did automatically print with no prompt but I can't figure out how exactly to recreate it.
Upvotes: 1
Views: 849
Reputation: 125
I figured it out. The proper line is:
DoCmd.OpenReport "Results", , "", "", acNormal
I didn't need the view report parameter.
Upvotes: 1