Cancel a Save

G

Guest

I have an Access 97 database and I'm having trouble canceling a save command
(or undoing the save). Here's the setup:

If a user clicks the EDIT button certain fields are enabled for editing.
When SAVE is clicked a comment form opens for a required comment. If the
user closes the comment form w/o saving, the cmdSave code of the original
form detects this and displays a message box asking if they want to cancel
the edit. If they click yes, I want to cancel the changes they made. I've
tried many things including cancelevent, using the form's beforeupdate to
detect the value of a text box that is updated when user responds to "yes"
cancel edit. No matter what I try (and I've used the acUNDO MenuItem) the
edit gets saved.

How should I go about doing this?

I saw a sub routine in the Access help that was an "undo" procedure that
used .OldValue property to reset the controls. Is there a better way?
Could I add a Cancel arguement to the cmdSave_Click() procedure?

Thanks
 
G

Graham Mandeno

Hi LeAnn

Me.Undo executed from within the form's own module will undo ALL unsaved
changes to the current record.
 

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