Lock a field after data entry so value cannot be changed

L

Lori LeRoy

I have a form used for receiving where the receiver selects his/her name when
receiving product. Once they have entered their name I want to 'lock' that
field so it cannot be changed by anyone in that form at a later date. Any
ideas? Thank you!
 
B

Beetle

Using the Current event of the form you could check if
it is on a new record and if not, lock the control.

Private Sub Form_Current ()

Me!YourControl.Locked = Not Me.NewRecord

End Sub

Replacing YourControl with the actual name of your text box,
combo box, etc.
 
L

Lori LeRoy

That worked! Thank you very much.

Beetle said:
Using the Current event of the form you could check if
it is on a new record and if not, lock the control.

Private Sub Form_Current ()

Me!YourControl.Locked = Not Me.NewRecord

End Sub

Replacing YourControl with the actual name of your text box,
combo box, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top