Bumbino said:
I have a form with an embedded subform. On the main form, I have a cancel
button that performs ME.Undo. I would like to get it to also Undo the
entries on the subform but cannot get it to work. Any ideas??
Once the focus moves back to the main form from the subform, the subform's
record will automatically be saved (if it has been modified). There's
really nothing much you can do about this, so by the time you click your
button on the main form, it's too late to undo the record on the subform.
You might try using a button on a custom command bar instead. You should be
able to undo both the subform and the main form from there. You still won't
be able to undo multiple records on the subform, if that was what you had in
mind; only the record that is currently unsaved.
If you need to undo multiple records on the subform, your best bet is
probably to base the subform on a temporary table, so that you can just
discard all the records in that table, or else accept them by copying them
into the "real" table.