Johnny Drama
In need of beer...
- Local time
- Yesterday, 19:54
- Joined
- Dec 12, 2008
- Messages
- 211
Hello all,
I have a menu form that has several cmd buttons on it. The buttons are enabled/disabled depending on the users permission level. For the admin I want all buttons to be enabled, however it appears that VBA reads the first condition and then skips the rest. Below is the code:
If User.AccessID = 1 Then
Me.cmdAdmin.Enabled = True
Me.cmdIad1.Enabled = True
Me.cmdMgmt.Enabled = True
Else
Me.cmdAdmin.Enabled = False
Me.cmdIad1.Enabled = False
Me.cmdMgmt.Enabled = False
End If
If User.AccessID = 2 Then
Me.cmdIad1.Enabled = True
Else
Me.cmdIad1.Enabled = False
End If
If User.AccessID = 3 Then
Me.cmdMgmt.Enabled = True
Else
Me.cmdMgmt.Enabled = False
End If
Any thoughts on what I'm doing wrong? Am I using the wrong conditional statement?
Thanks
I have a menu form that has several cmd buttons on it. The buttons are enabled/disabled depending on the users permission level. For the admin I want all buttons to be enabled, however it appears that VBA reads the first condition and then skips the rest. Below is the code:
If User.AccessID = 1 Then
Me.cmdAdmin.Enabled = True
Me.cmdIad1.Enabled = True
Me.cmdMgmt.Enabled = True
Else
Me.cmdAdmin.Enabled = False
Me.cmdIad1.Enabled = False
Me.cmdMgmt.Enabled = False
End If
If User.AccessID = 2 Then
Me.cmdIad1.Enabled = True
Else
Me.cmdIad1.Enabled = False
End If
If User.AccessID = 3 Then
Me.cmdMgmt.Enabled = True
Else
Me.cmdMgmt.Enabled = False
End If
Any thoughts on what I'm doing wrong? Am I using the wrong conditional statement?
Thanks