Tina, here's what I'm doing:
1) In the parent form, there is a drop-down that queries a second table,
converting the numeric foreign key to something human-understandable (e.g. a
type of music 'gospel' rather than 153) by using a combobox with the numeric,
stored item having 0 width and the human-readable text as the visible column.
2) When the user enters a value not in the list, the NotInList event fires.
I then load a form that permits the user to edit the subordinate table (e.g.
music types), with it set to add a new record with the type text set to the
value of the text entered in the combobox of the parent form.
So far, so good.
3) To make the subform load with the focus on the text-based control, the
Current event of the form scans the list of controls, finding the control
that has the field displayed from the parent's combobox form (which I pass in
OpenArgs, along with the newly-created value from the NotInList event).
4) What I wanted to be able to do was detect the situation where the control
couldn't be located for some reason and then abort the subform.
Unfortunately, there doesn't appear to be any way to programmatically
terminate a form from within that same form, as DoCmd.Close gives you an
error if you use it to close yourself.
5) What I've done to circumvent this is to enter an event loop in the parent
form (a while loop looking for the subform to place a flag-character in its
Tag field, giving control to the event processor inside the while loop).
when the loop detects this flag set, it then does a DoCmd.Close on the
suborndinate form. This is a huge klooge, but I can't see any way around it.
--Dale--