Thank You very much for this...
I have tried this and it gives the value of actextbox as
109 combo box as 111 and the list box as 110 what does
this mean?
Also its pulling up an error (on open) which says:
-----------------------------------------------------
Runtime error 91
object variable with block variable not set
-----------------------------------------------------
Whats this all about here is the code I have used:
-----------------------------------------------------
Dim ctl As Control
If usrlevel = 3 Then
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
ctl.Locked = True
End If
Next ctl
For Each ctl In Me.Controls
If ctl.ControlType = acComboBox Then
ctl.Locked = True
End If
Next
For Each ctl In Me.Controls
If ctl.ControlType = acListBox Then
ctl.Locked = True
End If
Next ctl
Else
If usrlevel = 1 Or 2 Then
For Each crtl In Me.Controls
If ctl.ControlType = acTextBox Then <----- Error here
ctl.Locked = False
End If
Next
For Each ctl In Me.Controls
If ctl.ControlType = acComboBox Then
ctl.Locked = False
End If
Next
For Each ctl In Me.Controls
If ctl.ControlType = acListBox Then
ctl.Locked = False
End If
Next ctl
End If
End If
End Sub
----------------------------------------------------------
What have I done wrong?
I appreciate all the help that has been given on this...
Many Thanks
James