Save works but does not COMMIT

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I just posted a question earlier about DoCmd.RunCommand acCmdSaveRecord does
not work. Tina gave me work around for that and it worked.

However, now I find out with more testing, if user clicks 'UnDO' button then
all edits that were made are lost.

So, I need to know is there a "COMMIT' like in sql so I know for sure the
changes are saved and 'Undo' command will not reverse it.

Thank you,
AccessTester1
 
Have you verified that the undo is indeed happening AFTER the save?

If you have a front-end/back-end db, open both. (If not, make another db and
link to the table in question). In the front end, open the form to edit the
record. In the back end, open the table directly and note the current
contents of the record & field(s) being edited. Close the table, then change
something via the front end. Reopen the table in the back end without
navigating to a different record on your form. Has the record changed? If so,
then it was correctly saved.

If so, close the table & click the Undo button on your form. Reopen the
table in the back end and look at the record again. Has it actually reverted?

If not, then perhaps this has to do with how/whether all the controls on
your form are correctly bound.
 
I will try that out. However, regardless of the outcome, user's perception
will not change, since, the form they're editing will show their changes
being undone. So, they will continue to try to edit it when infect changes
have taken place if it works as you are describing.

For now, I am living with the work around of not doing UnDO if Me.Dirty is
false. Am not sure if there are any side effects to it, but, time will tell.

Thanks,
AccessTester1
 
Me.Dirty simply means that something has changed. If your workaround simply
does not undo if Me.Dirty is False, then what you are really doing is not
undoing if nothing has changed and there is therefore nothing to undo anyway.
(This is assuming that all relevant controls are bound to fields in the
RecordSource of the form.)

If the record is actually saved with the edits in place, an undo cannot
revert; the prior values only exist in the controls until the record is
saved, at which time the .OldValue property is reset. If values on the form
are being undone, it means the changes were never saved.

It sounds like what you really want to do is prevent the user from undoing
changes when he really wants to save the changes. However, how is your
program to know which outcome the user wants. If there is some question, you
might consider using a message box on the click of the undo button asking the
user if he really wants to undo and cancelling if not.
 
Back
Top