Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

locking records

Status
Not open for further replies.

jommyjet

Technical User
May 19, 2003
49
US
how would I prompt for a field to be locked. I imaginme it's pretty easy, have a combobox to select field to be locked, say combobox
then a button would run an event like
Me![combobox].Locked = true
thanks
 
You've answered your own question except you wouldn't use a button. Use the AfterUpdate event on the combo box and some conditional code (IF statements or SELECT CASE) to lock the selected field.
 
Try putting something like this in your combobox OnChange event.

If Me.combobox.Value = "Text1" Then
Me.Text1.Enabled = False
Me.Text2.Enabled = True
End If
If Me.combobox.Value = "Text2" Then
Me.Text2.Enabled = False
Me.Text1.Enabled = True
End If

You may also want to put all the possible combo box value's in a case statement, depending on how many there are.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top