Locking Textboxes and Comboboxes based on username (1 Viewer)

pat_nospam

Registered User.
Local time
Today, 18:31
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 :)
 

Mile-O

Back once again...
Local time
Today, 18:31
Joined
Dec 10, 2002
Messages
11,316
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
 

pat_nospam

Registered User.
Local time
Today, 18:31
Joined
Oct 14, 2003
Messages
151
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
 

Mile-O

Back once again...
Local time
Today, 18:31
Joined
Dec 10, 2002
Messages
11,316
Code:
Me.AllowAdditions = False
Me.AllowEdits = False
Me.AllowDeletions = False
 

Users who are viewing this thread

Top Bottom