Cancelling update

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I am setting Cancel = true in BeforeUpdate event of a form but the edits by
user still stay there. How can I undo user edits on the form?

Many Thanks

Regards
 
John said:
Hi

I am setting Cancel = true in BeforeUpdate event of a form but the edits
by user still stay there. How can I undo user edits on the form?


In addition to setting Cancel = True, undo the form:

Cancel = True
Me.Undo
 
Just before the Cancel = True line in your code, add the line:

Me.Undo

That will undo the record, and cancel the save, but you will still use an
autonumber, if that concerns you.
 
Back
Top