VBA Open/Close Navigation Pane A2007

spikepl

Eledittingent Beliped
Local time
Today, 13:27
Joined
Nov 3, 2010
Messages
6,142
I can't find (by google) any code to open/close the navigation pane from VBA.

I have found code to hide/unhide it, but when I unhide it, it's open. I'd like to be able to hide/unhide it, but when unhidden, the thing should preferably remain closed.

Any hints?

Code:
Private Sub cmdHideNP_Click()

DoCmd.NavigateTo "acNavigationCategoryObjectType"

DoCmd.RunCommand acCmdWindowHide

End Sub


Private Sub cmdUnhideNP_Click()

DoCmd.SelectObject acTable, , True

End Sub
 
Not exactly sure what you mean by some of that, but here is what I use. I just put something in the sample databases forum that you might like, but I'm still waiting for a moderator to approve it.

Code:
Public bolHideNavPane as Boolean

Private Sub cmdHideRibbon_Click()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Thanks NigelShaw
'http://www.access-programmers.co.uk/forums/showthread.php?t=206281
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    strform = "frmsettings"
    Select Case bolHideNavPane
        Case False
            DoCmd.SelectObject acForm, strform, True
            bolHideNavPane = True
            Me.cmdHideNavPane.Caption = "Hide Nav Pane"
        Case True
            Me.cmdHideNavPane.Caption = "Show Nav Pane"
            DoCmd.SelectObject acForm, strform, True
            DoCmd.RunCommand acCmdWindowHide
            bolHideNavPane = False
        Case Else
            bolHideNavPane = True
    End Select

edit- Maybe what your looking for is this.
 
Last edited:
Your link is what I meant Thanks.

Code:
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.Minimize
 

Users who are viewing this thread

Back
Top Bottom