I'm trying to stop users deleting an existing value in a field. If
they go to an existing record and hit delete, I want to give an error
message and reverse the change. The BeforeUpdate event is firing and
they get the error message. But when they click "OK", the change is
not undone. They can hit enter and go on to the next field with the
null not being undone. However, if they change to an illegal (not
null) value, the change is undone.
The code is:
If IsNull(Me![whatever]) then
MsgBox "blah blah"
Me![whatever].Undo
Cancel = True
End If
I've tried it with the .Undo and the Cancel reversed, with SendKeys
"{ESC}" and various combination. No joy. However, if I manually hit
the Esc key, it usually undoes the change.
It's a bound control on a bound form. Access 97 and SQL Server 2000.
RecordSource returns one record.
This does not compute.
--
Regards.
Richard.