Locking a field for update once data has been entered.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to be able to lock a memo field once a user has input data into it so
that it cannot be changed.
Can someone please provide me with the code i need to include.
Thanks.
 
Two situations to consider. A new record or an existing record where no data
has been entered in the memo field. Since you did not specify, I will code
it so that it is available for entry until the user has made an entry then
moved away from the current record. Then, it will not be editable from a
form. If your users have direct access to tables, you really can't prevent
it.

In the Form Current event, test to see if the control bound to the field is
Null:

If Not IsNull(Me.MyMemo) Then
Me.MyMemo.Enabled = False
Me.MyMemo.Locked = True
End If
 
Back
Top