Preventing Changes To A Field Containing Information

jaythom

New member
Local time
Today, 17:48
Joined
Aug 16, 2003
Messages
7
Hello,

I am curious how to prevent changes to a field after that field has had data entered into it.

I tried:

Before Update

If IsNull(Me!User) Then
MsgBox "This is allowed"
Else
MsgBox "This is not allowed"
Cancel = True
End If

I figured that until the User field had the value saved to the field, it would have a Null value. I checked in the Immediate window and debug.print showed this to be true. With the code above, it would not prevent changes even after the field previously contained information.

Any help would be greatly appreciated!

John
 
John,

Code:
If IsNull(Me.User.OldValue) Then
   MsgBox ("This is allowed")
Else
   MsgBox ("This NOT is allowed")  
   Me.User = Me.User.OldValue
End If

Wayne
 

Users who are viewing this thread

Back
Top Bottom