CurrentUser() is only available if you have user-level security enabled, and
have set it up. You can also grab the windows login name:
http://www.mvps.org/access/api/api0008.htm
and use that to run your code.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
"Secret Squirrel" <(E-Mail Removed)> wrote in
message news:945816B5-EF0C-4F66-A6B5-(E-Mail Removed)...
> 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