Your info got me pointed in the right direction. I wanted to prevent accidental modification of a key field, it isn't the PK of the record but is still quite important. I came up with the following code that does the trick quite well:
Code:
Private Sub STARSID_LostFocus()
'can't directly check for .Dirty, must compare to .OldValue
With STARSID
If .Value <> .OldValue Then
retval = MsgBox("You have changed the STARS ID. Did you mean to do this? Selecting No will reset it to the original value.", vbYesNo)
If retval = vbNo Then .Value = .OldValue
End If
End With
End Sub
I'm tempted to clear Dirty for the form, but the user might have changed other fields.