Insert, No Edit

D

Dorci

Access 2002: How can I allow editing of a particular field when a record is
first created, but not allow editing once the new record has been saved?
Thanks.
 
M

MacDermott

You can use the form's OnCurrent event procedure to run code like this:
If Me.NewRecord Then
MyField.Locked=False
Else
MyField.Locked=True
End If
 
M

Marshall Barton

Dorci said:
Access 2002: How can I allow editing of a particular field when a record is
first created, but not allow editing once the new record has been saved?


How do you know that users will NEVER make a mistake
entering the field's value??

Use the form's Current event:

Me.controlname.Locked = Not Me.NewRecord
 
D

Dorci

That worked. Thanks!
In the event the user makes a mistake entering the field's value, an
administrator can correct the value in the backend database. It's more
critical (and more likely) that the users do not accidentally change an
existing record's value as it is the key field. Thanks for the advice!
 
Top