G
Guest
Hi,
I have been testing the Undo commands via a button on a form, and I'm
curious as to the differences between these two: Me.Undo and DoCmd.RunCommand
(acCmdUndo).
I've noticed that Me.Undo doesn't undo a change if I save the record (I have
a button on the form for this, using acCmdSaveRecord) after editing it,
whereas acCmdUndo works even after saving the record.
So, for example, if for an existing record, if I change the value in the
city field from "Antigua" to "Jamaica", and hit the "Save" button, and then
hit the Undo button, if the code is Me.Undo, it doesn't do anything, but if
the code is acCmdUndo, it changes "Jamaica" back to "Antigua".
Is there a reason for these two different behaviors? Are there situations
when one is used over the other?
I'm just curious, and if someone can shed more light on this, will
appreciate it.
Thanks.
-Amit
I have been testing the Undo commands via a button on a form, and I'm
curious as to the differences between these two: Me.Undo and DoCmd.RunCommand
(acCmdUndo).
I've noticed that Me.Undo doesn't undo a change if I save the record (I have
a button on the form for this, using acCmdSaveRecord) after editing it,
whereas acCmdUndo works even after saving the record.
So, for example, if for an existing record, if I change the value in the
city field from "Antigua" to "Jamaica", and hit the "Save" button, and then
hit the Undo button, if the code is Me.Undo, it doesn't do anything, but if
the code is acCmdUndo, it changes "Jamaica" back to "Antigua".
Is there a reason for these two different behaviors? Are there situations
when one is used over the other?
I'm just curious, and if someone can shed more light on this, will
appreciate it.
Thanks.
-Amit