Help with a Custom Menu Module

cross5900

Blarg!
Local time
Today, 04:08
Joined
Mar 24, 2006
Messages
92
I have created a module that will enable a custom menubar if it meets the specified requirements. The only problem I have right now is I can not get rid of the standard menu bar. My code I am using is below:

Code:
Public Function CmdBars()
'This Function will allow for a custom menu bar to be activated and is set by the user's Rights Level.

    Dim aEmp As Variant
    aEmp = DLookup("RightsLevel", "Users", "UserID='" & Environ("username") & "'")

    If aEmp = 100 Then
        CommandBars("Menu Bar").Enabled = False
        CommandBars("Menu Bar").Visible = False
        CommandBars("SOC_Sup_Bar").Enabled = True
        CommandBars("SOC_Sup_Bar").Visible = True
    End If
    
    If aEmp = 0 Then
        CommandBars("Menu Bar").Enabled = False
        CommandBars("Menu Bar").Visible = False
        CommandBars("SOC_Assoc_Bar").Enabled = True
        CommandBars("SOC_Assoc_Bar").Visible = True
    End If
 End Function

Any ideas?
 
Have you single stepped the code to see what is hapening?
 
Code:
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
Code:
DoCmd.ShowToolbar "Database", acToolbarNo
 
I did but it really did not tell me anything. ghudson I am at home but I will give that a shot and let ya know.

I do know that having it set to default on one of the menu's on load and doing the code without the "menu bar" lines it works perfectly...but I still wanna know how to do it in code.

Thanks for the responses btw
 

Users who are viewing this thread

Back
Top Bottom