When users log into my application, their UserName is stored in a public variable named strUser. I'm trying to program a form's OnOpen event to check if strUser = "JaneDoe" and, if it does, I need to lock all controls on the form. I can't seem to figure out how to lock all controls.
I've tried setting the .AllowEdits and .AllowAdditions properties to false, thinking this would be essentially the same as locking all controls, but these properties actually cause all form controls to be hidden.
How can I lock all form controls? Thanks.
--
Regards,
Mike
I've tried setting the .AllowEdits and .AllowAdditions properties to false, thinking this would be essentially the same as locking all controls, but these properties actually cause all form controls to be hidden.
Code:
Private Sub Form_Open(Cancel As Integer)
If struser = "JaneDoe" Then
Me.AllowEdits = False
Me.AllowAdditions = False
End If
End Sub
How can I lock all form controls? Thanks.
--
Regards,
Mike