Navigation Pane appearing at print command (1 Viewer)

Robbyp2001

Registered User.
Local time
Today, 22:42
Joined
Oct 8, 2011
Messages
143
This problem has got me scratching my head. I would like the report to simply print without opening and I have a button on a form that orders 2 copies of a report to be printed. The report is an invoice for items purchased.

Everything works well except that when I click the button, the Navigation Pane appears and pushes the form to the side. This is despite the fact that the Navigation Pane is hidden at start-up. The Navigation Pane remains open thereafter until the dbase is exited and restarted.

The code I am using is thus:

Private Sub Command22_Click()

DoCmd.SelectObject acReport, "InvoiceClothing", True
DoCmd.PrintOut , , , , 2

End Sub

Any suggestions on how I can keep the Navigation Pane hidden at all times?

Many thanks


Rob
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:42
Joined
May 7, 2009
Messages
19,227
try this:


Private Sub Command22_Click()
DoCmd.OpenReport "InvoiceClothing", acViewPreview, , , acHidden
DoCmd.PrintOut , , , , 2
DoCmd.Close acReport, "InvoiceClothing", acSaveNo
End Sub
 

Robbyp2001

Registered User.
Local time
Today, 22:42
Joined
Oct 8, 2011
Messages
143
Arnel, once again you have come to the rescue. Many thanks

Rob
 

Users who are viewing this thread

Top Bottom