VBA : Switch category group in Navigation panel (1 Viewer)

Nyanko

Registered User.
Local time
Today, 15:50
Joined
Apr 21, 2005
Messages
57
Hi,

I'm needing to find a way to hide almost all of the access objects in the navigation pane, but not all of them. I've found that I can create a navigation group and add the form (or two that I want to be still available).

https://support.office.com/en-gb/ar...ion-Pane-772605e2-2a29-4c05-a521-aa53f33d9b01

Is there a way I can switch between the default all objects group and the custom group using VBA ?

Code:
    'Check UserLevel against lkp_Employees Table
    UserLevel = DLookup("[UserLevel]", "lkp_Employees", "[NetworkID]='" & fOSUserName() & "'")
    
    'Hide navigation pane from Non Admins
    If UserLevel = "Admin" Then
       [I] Show all access objects in default view[/I]
    Else
        [I]Only show the custom group called "MyNavigation"[/I]
   End If

My end users aren't that tech savvy so I'm not worried about them breaching my security, but I am worried about
a) deleting backend things by mistake
and
b) closing the switchboard by mistake and not knowing what to do :D
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:50
Joined
Aug 30, 2003
Messages
36,139
This isn't really an answer to your question, but most of us hide the nav pane completely. We provide users with forms/reports to view and interact their data. They have no need for the nav pane. Do yours really need to see/use it?
 

Nyanko

Registered User.
Local time
Today, 15:50
Joined
Apr 21, 2005
Messages
57
Hi,

I found the answer to my problem :

Code:
    'Hide navigation buttons From NonAdmins
    If UserLevel = "Admin" Then
        'Show full navigation pane
        DoCmd.NavigateTo "acNavigationCategoryObjectType" ' All Objects
        DoCmd.Maximize
        'Hide Manage Employees
        Forms!MainSwitchboard.btn_Employees.Visible = True
        Forms!MainSwitchboard.FormManageEmployees.Visible = True
        'Hide Search& Edit Commissions
        Forms!MainSwitchboard.btn_Commissions.Visible = True
        Forms!MainSwitchboard.FormEditCommission.Visible = True
        'Hide Audit Trail
        Forms!MainSwitchboard.lblAuditTrail.Visible = True
        Forms!MainSwitchboard.cmb_AuditTrail.Visible = True
    Else
        'Show limited navigation pane
        DoCmd.NavigateTo "MyNavigation", "Navigation"
        DoCmd.Maximize
        'Hide Manage Employees
        Forms!MainSwitchboard.btn_Employees.Visible = False
        Forms!MainSwitchboard.FormManageEmployees.Visible = False
        'Hide Search& Edit Commissions
        Forms!MainSwitchboard.btn_Commissions.Visible = False
        Forms!MainSwitchboard.FormEditCommission.Visible = False
        'Hide Audit Trail
        Forms!MainSwitchboard.lblAuditTrail.Visible = False
        Forms!MainSwitchboard.cmb_AuditTrail.Visible = False
    End If
 
Last edited:

Users who are viewing this thread

Top Bottom