Locking a field for update once data has been entered.

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.
 
G

Guest

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
 

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