Why is the navigation pane suddenly showing? (1 Viewer)

anb001

Registered User.
Local time
Today, 02:00
Joined
Jul 5, 2004
Messages
197
I have a database, where ribbons, navigation pane etc is disabled through the current database menu.

When using the database, it more or less remain hidden.

But when I run below code, the navigation pane suddenly opens, and stays open (well, it can be minimized and maximized, but not hidden).

Code:
Private Sub cmdPrint_Click()
Dim counter

    For counter = 1 To 10

        If Not Me("txtPrintNumber" & counter).Value = 0 And (Me("cboSJANumber" & counter) <> Null Or Me("cboSJANumber" & counter) <> "") Then
        Me.txtSJAPrint.Value = Me("cboSJANumber" & counter)

        DoCmd.SelectObject acReport, "rptSJAFavPrint_CPT", True
        DoCmd.PrintOut acPrintAll, , , , Me("txtPrintNumber" & counter)
        Else
        End If

        Me("txtPrintNumber" & counter) = "0"
    
    Next counter
End If

End Sub

I have tried both with an ACCDB and an ACCDE, but the same is happening.

Does anyone know why it is happening, and can you inform me how I can fix it.

Thanks.

Anders
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:00
Joined
Feb 19, 2002
Messages
43,774
I have run into this in several situations regarding external files. You could call it a bug but MS would probably call it a feature. The bad thing is there is no way to hide the nav pain (sic) once this happens. I do have a possible solution though. Rename the .accde to .accdr. This tells Access to pretend to be the runtime engine when running this database. Since you can't get to the nav pane while using the runtime engine, this solves the problems. Of course, it may cause others since it requires that you create custom menus and all errors must be trapped, etc.
 

anb001

Registered User.
Local time
Today, 02:00
Joined
Jul 5, 2004
Messages
197
I tried to rename the accde to accdr, but then it tells me that the "PrintOut" method isn't available. Can that be fixed?

Otherwise I end the print code with:

Code:
DoCmd.SelectObject acTable, True
    DoCmd.RunCommand acCmdWindowHide

At least the nav pane dissappear again, eventhough still annoying!
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:00
Joined
Feb 19, 2002
Messages
43,774
That's unfortunate. I don't understand why PrintOut would not be allowed by the runtime engine. See if there is a macro action for PrintOut for your Access version. You might be able to use a macro (ugh!) alternative.
 

anb001

Registered User.
Local time
Today, 02:00
Joined
Jul 5, 2004
Messages
197
I'll try the macro way :)

I have attached a screendump showing the error.
 

Attachments

  • Printout.jpg
    Printout.jpg
    83.2 KB · Views: 119

Users who are viewing this thread

Top Bottom