I have my own menu bar which i have created called "Angola LNG Incident Reporting". My intention was to dim or disable sub-menu items base on user name.
Following code i am using right now. It works just fine to dim but doesn't appears to be working base one user's name. Is there any thing wrong of doing this.
Appreciate if you help me out
Thanks,
** Edit **
This question was split away from How i can stop users running MDB file from another location?.
Following code i am using right now. It works just fine to dim but doesn't appears to be working base one user's name. Is there any thing wrong of doing this.
Code:
If Me.UserName.Value = "aman" Then CommandBars("Angola LNG Incident Reporting").Controls(1).Controls(1).Enabled = False CommandBars("Angola LNG Incident Reporting").Controls(1).Controls(2).Enabled = False CommandBars("Angola LNG Incident Reporting").Controls(1).Controls(3).Enabled = False ElseIf Me.UserName.Value = "McAnthony" Then CommandBars("Angola LNG Incident Reporting").Controls(1).Controls(1).Enabled = True CommandBars("Angola LNG Incident Reporting").Controls(1).Controls(2).Enabled = True CommandBars("Angola LNG Incident Reporting").Controls(1).Controls(3).Enabled = True End If
Thanks,
** Edit **
This question was split away from How i can stop users running MDB file from another location?.
Comment