MS Access report opens Navigation pane when printing multiple copies via VBA -


i have report using print labels , works fine except when report prints, navigation pane opens. have set database options not show navigation pane , other particular report remains hidden. here vba using print report:

dim intcopies integer intcopies = me.txtcopies docmd.selectobject acreport, "rptshippinglabeltmo", true docmd.printout , , , , intcopies 

the report set print specific printer , need print multiple copies without having use type of dialog boxes. how can report print without navigation pane opening?

the third argument, innavigationpane, indicates whether object should selected in database window (access versions <= 2003) or navigation pane (access >= 2007). use false tell access not select report in navigation pane , shouldn't display navigation pane.

docmd.selectobject acreport, "rptshippinglabeltmo", false 

however, if report not open, use openreport instead of selectobject, , close afterward.

docmd.openreport "rptshippinglabeltmo", acviewpreview 'docmd.printout , , , , intcopies docmd.printout copies:=intcopies docmd.close acreport, "rptshippinglabeltmo" 

Comments