Close form without saving changes



Can anyone help me with a code so that users of my databse can close the form
or click cancel and all the changes to the record can be disregarded? I know
that closing the form automatically save the changes. I would like an option
or command button or code that allows exiting the form without saving the
changes. Please help. Thank you.


Undo only undo the last typed changes. I would like a Cancel button so the
user can cancel all the changes after typing a whole lot of text.

Jeff Boyce

Hmmm? Perhaps I'm confused. I thought I used undo to clear all the fields
(i.e., the record).

Yes, here's the code behind an <Undo> button on one of my forms:

If Me.Dirty Then
End If

So maybe Me.Undo rather than DoCmd.Undo...


Jeff Boyce
Microsoft Office/Access MVP

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