Code to determine if Navigation Pane is active or not

NearImpossible

Registered User.
Local time
Yesterday, 20:07
Joined
Jul 12, 2019
Messages
225
I have the navigation pane set to be closed via the Access Options, however there are occasions when I need to use so have I have code to enable /disable it as needed which works fine.

This issue i'm running into is when the navigation pane is active, my forms shift to the right and I can no longer click on my Exit Button which I added to the top right of the form, as the scroll bars are set to none

is it possible for when a form loads to detect if the navigation pane is active and then enable scrollbars if it is?

Please advise?
 
Actually I just realized i'm the only one can enable/disable the navigation pane via the code and I was setting this up on a laptop with a lower resolution than my screens so it won't be an issue for me.

However, I would still like to know if it is possible to determine if the Navigation Pane is active or not when a form loads

thank you
kevin
 
Actually I just realized i'm the only one can enable/disable the navigation pane via the code and I was setting this up on a laptop with a lower resolution than my screens so it won't be an issue for me.

However, I would still like to know if it is possible to determine if the Navigation Pane is active or not when a form loads

thank you
kevin
Hi. Sounds to me like it's more about you need to determine if the current screen size is smaller than your normal one, regardless of whether the Nav Pane is open or not.
 
Why not just code to close the navigation pane each time the form loads?
 
The navigation pane should NEVER be visible in the normal operation of the application. Users should only have access to your forms and reports. Allowing them access to backstage objects is a recipe for disaster.
 
The first 2 sentences of the original post tell you that the nav pane is not visible during normal operation of the db?
@NearImpossible, if this is only an issue for you while developing, just click the pane arrow to minimize it?
 
will return True if the navigation pane is visible:

If Currentdb.Properties("StartUpShowDBWindow") Then
' navigation pane is visible
Else
' navigation pane is hidden
End If
 
will return True if the navigation pane is visible:

If Currentdb.Properties("StartUpShowDBWindow") Then
' navigation pane is visible
Else
' navigation pane is hidden
End If
Actually that will err if the property doesn't exist yet, and isn't reliable.
 
why not Handle the error:

Code:
'arnelgp
'
Public Function IsNavigationPaneVisible() As Boolean
On Error GoTo NoProp

    IsNavigationPaneVisible = CurrentDb.Properties("StartUpShowDBWindow")
 
GracefulExit:
    Exit Function
NoProp:
    If Err.Number = 3270 Then 'property not found
        CurrentDb.Properties.Append CurrentDb.CreateProperty("StartUpShowDBWindow", dbInteger, -1)
        Resume
    Else
        MsgBox Err.Number & ": " & Err.Description
        Resume GracefulExit
    End If


End Function
 

Users who are viewing this thread

Back
Top Bottom