Custom MenuBar

S

Secret Squirrel

I'm having a brain freeze with setting up my custom menubar. I have 2 menus
bars, 1 for all users (CustomMenu), and 1 for me (CustomMenuLS). I have the
following code firing via my autoexec macro but for some reason it's loading
the DB without any menubar. From the startup options I have the "CustomMenu"
loading as the default menubar. Am I doing something wrong here? How do I get
my menubar to load when I login and the other to load whenever someone else
logs in?

Public Function CustomLoad()

If CurrentUser() = "squirrel" Then
DoCmd.ShowToolbar "CustomMenu", acToolbarNo
Else
DoCmd.ShowToolbar "CustomMenuLS", acToolbarYes
End If

End Function
 
D

Dale Fye

I use the windows user name, as mentioned by Arvin. My guess is that your
windows username is not squirrel, but if it is, maybe this will do what you
want. Otherwise, just change "squirrel" to your username.

How about:

Public Function CustomLoad()

If fOSUserName() = "squirrel" Then
DoCmd.ShowToolbar "CustomMenu", acToolbarNo
DoCmd.ShowToolbar "CustomMenuLS", acToolbarYes
Else
DoCmd.ShowToolbar "CustomMenu", acToolbarYes
DoCmd.ShowToolbar "CustomMenuLS", acToolbarNo
End If

End Function
--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 
Top