Question : How do I prevent Navigation Pane from expanding when I activate a command button?

I have a command button that prints 2 copies of a report.  The code is listed below.  Here's the problem:  When the command button is clicked, the navigation pane expands...even though the settings are set to NOT show the Navigation Pane.  So when the database is initially opened the Navigation Pane is NOT in viewable, but once the command button is clicked, it expands.

Can anyone assist me in determining why this is happening.  I do not want the Navigation Pane to expand.

HERE'S THE CODE I HAVE:

Private Sub WCoutListCB_Click()

DoCmd.SelectObject acReport, "OUT TO WATCH COMMANDER LIST", True
DoCmd.PrintOut , , , , 2

End Sub


Thank in advance for all your assitance.

Answer : How do I prevent Navigation Pane from expanding when I activate a command button?

Because you are selecting the object.

If all you want to do is print two copies of the report, you could try:

docmd.OpenReport "Out to watch commander list",  acViewPreview
docmd.PrintOut acPrintAll, , , , 2
docmd.Close acReport, "Out to watch commander list"
Random Solutions  
 
programming4us programming4us