if you add/edit data in the main form, then move to the subform, the record
in the main form is automatically saved by Access, and you can't prevent
that from happening. also, if you add/edit data in the subform, and then
move back to the main form, the subform record is automatically saved by
Access and, again, you can't prevent that from happening. once the data is
saved to a table, an Undo command does not work.
i can't think of any way around that, other than maybe to use "shadow"
controls and a lot of ugly code to essentially re-edit the record (main form
and/or subform) back to the values prior to the save. i think it would be a
nightmare to do it, and maybe impossible to make it foolproof.
an alternative might be to add code to both the main form and subform's
BeforeUpdate events to alert the user that the record is about to be saved,
and give him/her the opportunity to stop the save and do an Undo at that
point. note that if you make changes in the main form, the BeforeUpdate
event will fire when you try to move to the subform, and vice versa.
hth