Non-Updatable

fernin8r

Registered User.
Local time
Today, 11:27
Joined
May 28, 2002
Messages
142
This is a shot in the dark...

Is there to way to make a field on a form non-updatable. I have a field bound to a table which I do not want to change on old records, but i would like to be able to use the field to create a new record and be able to type in.

This leaves out locking the field.

The reason being. i use the field to create a new record from an old record so that the user can copy the old record by only changing one field. This works fine. The issue i'm having is...the field can't be updated. If the user accidentally tabs out of the field, this isn't good.

I hope someone can understand this. Thanks
 
If Me.NewRecord=True Then
Me.MyField. Locked=False
Else
Me.MyField.Locked=True
End If
 
Read Help about OLDVALUE (Access2000 and above).

In the BeforeUpdate of the field you could put something like (approx):

If Not isNull(MyField.OldValue)then MyField = OldValue.

So if it's a new record, it will change, otherwise it won't...
 
cogent1 wrote
<<
Read Help about OLDVALUE (Access2000 and above).
>>

Oldvalue is available in Access 97 as well.

RichM
 
Thanks guys...cogent, i used the .OldValue but i was having errors in the BeforeUpdate. It worked perfectly in the AfterUpdate. (Just for future ref.)

Thanks again.
 

Users who are viewing this thread

Back
Top Bottom