Hide Nav Pane using set properties

speakers_86

Registered User.
Local time
Today, 18:34
Joined
May 17, 2007
Messages
1,919
How can I set the value of Display Navigation Pane? I have the code that sets it programatically, but how do I toggle this property in access?
 
Looking at that link, is there a way to change the value of the check box programatically? I know it doesn't make sense why I would want to do that, but there is certainly a reason for it!
 
What code do you have?

Two ways:

1.
Code:
    If NavIsHidden Then
        DoCmd.SelectObject acForm, , True
        NavIsHidden = False
    Else
        DoCmd.NavigateTo "acNavigationCategoryObjectType"
        DoCmd.RunCommand acCmdWindowHide
        NavIsHidden = True
    End If
where NavIsHidden is a variable that holds the state of the hidden value of the Nav Pane.

OR

2. Tweak the code above and when it comes to unhiding, trap the error if you can't acCmdWindowUnHide, then Resume to the SelectObject code.
 
I think I was looking for this:
Code:
StartUpProps "StartupShowDBWindow", Me!chkShowDBWindow

from here. I'll try this out later today.

edit-I am only trying to control the value of the check box in the current database options, this way when the db is opened, if it is not trusted, the nav pane is still hidden without any code running. Of course I could do it manually, but I want Aphrodite to be able to control that check box. I think SetOptions might work with StartupShowDBWindow. I'll report back later today.

edit- I just ran into this, so I think I got it.
 
Last edited:
That is not the Navigation Pane then. That is an Access Option.

And I don't know what Aphrodite is.
 
StartupShowDBWindow can change the value of the check box under current database, but for me in 2010, it doesn't seem to have any affect. I've restarted the db, with that check box set to 0, and the nav pane is still there.

edit- Okay, clearing that check box does hide the nav pane when I open the db, but only if there is no form that loads on startup, either by the startup form option or by an auto exec. When a form does load on db open, the nav pane is there. Any idea?

edit-Nevermind, I'm just an idiot. Setting this property works as expected.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom