L
Larry Salvucci
I'm trying to get custom menus to load when certain users log into the DB.
Here is what I'm using as a public function. I have it firing through my
AutoExec macro. Why is it always loading the "CustomMenuLS" no matter what
the Dlookup finds?
Public Function CustomLoad()
Dim intStore As Variant
Dim intStore1 As Variant
Dim intStore2 As Variant
intStore = DLookup("[AdminMenu]", "tblUsers", "[UserName] =
CurrentUser()")
intStore1 = DLookup("[AdminMenu]", "tblUsers", "[UserName] =
CurrentUser()")
intStore2 = DLookup("[AdminMenu]", "tblUsers", "[UserName] =
CurrentUser()")
If intStore = "0" Then
Application.CommandBars("CustomMenuLS").Enabled = True
Application.CommandBars("CustomMenu").Enabled = False
Application.CommandBars("CustomMainMenu").Enabled = False
Else
End If
If intStore1 = "1" Then
Application.CommandBars("CustomMenu").Enabled = True
Application.CommandBars("CustomMainMenu").Enabled = False
Application.CommandBars("CustomMenuLS").Enabled = False
Else
End If
If intStore2 = "2" Then
Application.CommandBars("CustomMainMenu").Enabled = True
Application.CommandBars("CustomMenu").Enabled = False
Application.CommandBars("CustomMenuLS").Enabled = False
Else
End If
End Function
Here is what I'm using as a public function. I have it firing through my
AutoExec macro. Why is it always loading the "CustomMenuLS" no matter what
the Dlookup finds?
Public Function CustomLoad()
Dim intStore As Variant
Dim intStore1 As Variant
Dim intStore2 As Variant
intStore = DLookup("[AdminMenu]", "tblUsers", "[UserName] =
CurrentUser()")
intStore1 = DLookup("[AdminMenu]", "tblUsers", "[UserName] =
CurrentUser()")
intStore2 = DLookup("[AdminMenu]", "tblUsers", "[UserName] =
CurrentUser()")
If intStore = "0" Then
Application.CommandBars("CustomMenuLS").Enabled = True
Application.CommandBars("CustomMenu").Enabled = False
Application.CommandBars("CustomMainMenu").Enabled = False
Else
End If
If intStore1 = "1" Then
Application.CommandBars("CustomMenu").Enabled = True
Application.CommandBars("CustomMainMenu").Enabled = False
Application.CommandBars("CustomMenuLS").Enabled = False
Else
End If
If intStore2 = "2" Then
Application.CommandBars("CustomMainMenu").Enabled = True
Application.CommandBars("CustomMenu").Enabled = False
Application.CommandBars("CustomMenuLS").Enabled = False
Else
End If
End Function