well, your original post asked how you can *keep* the cursor in the
subform...and the solution i posted will effectively do that, subject to the
caveat i included in the post. i tested the code in an A2000 db running in
A2003. i set the code in the BeforeUpdate event of a subform, and added a
command button in the mainform to run a Close action. i dirtied the subform
record, but left the required field blank, then clicked on the Close button
in the mainform. the Close code never ran, because the subform's
BeforeUpdate event ran first, and was cancelled, leaving the focus in the
subform record. clicking the "X" button in the top right corner of the
mainform (instead of the Close button on the form) prompted a warning
message that the subform record could not be saved if the form closed, with
Yes/No buttons to either cancel the Close, or close the form and lose the
edits to the subform record.
did you test the setup as posted? (i didn't understand the SetFocus
reference in your reply to my first post, since i didn't suggest using
SetFocus.) and what results did you observe?
hth