Shimotsuma
New member
- Local time
- Today, 12:31
- Joined
- May 2, 2013
- Messages
- 5
Hi all,
I want to disable all controls on a form based on a user role.
I have have the following code:
Of course the ctl.enabled property does not exist. I can't seem to find a way around this without typing all the names of the controls...
The controls have to remain visible.
Anyone can point me in the right direction?
Thanks in advance!
I want to disable all controls on a form based on a user role.
I have have the following code:
Code:
Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Me.Controls
If strRole <> "Administrative Assistant" Then
ctl.Enabled = False
Else
ctl.Enabled = True
End If
Next
End Sub
The controls have to remain visible.
Anyone can point me in the right direction?
Thanks in advance!