Cancelling update

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
 
D

Dirk Goldgar

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
 
A

Arvin Meyer [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top