That is correct: there is no way a Cancel button on the main form can work
for the record in the subform.
A Cancel button on a toolbar might work, or one in the subform itself.
However, if the user has the cursor in a Required field, backspaces the
entry out (so it's blank), they will be unable to leave the field (since it
is required), so they will not be able to click the button on the subform
either.
Best way is to forget the command button, and teach users to do one of
these:
- press the <Esc> key twice (once to undo the active field, and the second
to undo the record.)
- choose Undo from the Edit menu.
- use the Undo icon on the toolbar.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
WC LO said:
Hi Allen, thanks very much for your help. As you can tell I am very new
to Access. Can you suggest a way to test the subform's Dirty property from
the Click event of a button on the main form. As you say, Access will move
the subform before it moves the focus to the main form. So if I have a
CANCEL button in the main form, it seems I have no way to undo the saved
record of the subform.