Locking Textboxes and Comboboxes based on username

pat_nospam

Registered User.
Local time
Today, 17:51
Joined
Oct 14, 2003
Messages
151
Would this be the correct method of blanket locking a form based on form security userlevels? I'd like to set all textboxes "Locked = Yes" and comboboxes "Limit to List = Yes".

Code:
If UserLevel = "viewonly" Then
    Me.SomeTextBox.Locked = True
    Me.SomeComboBox.Limit to List = True
ElseIf UserLevel = "admin" Then
    Me.SomeTextBox.Locked = False
    Me.SomeComboBox.Limit to List = False
End If


As always, thanks for the assist!

Pat :)
 
Locked will prevent someone typing into the box;
Limiting to a list will only allow selections from the current rowsource

And it's LimitToList; not Limit To List
 
Mile --

Thanks for the confirmation, is there any easy way to blanket the changes to the form, or will I need to make a conditional switch for each separate object on the page?

Thanks again,

Pat
 
Code:
Me.AllowAdditions = False
Me.AllowEdits = False
Me.AllowDeletions = False
 

Users who are viewing this thread

Back
Top Bottom