Here is the circumstance and request for help.
I have an invoice form, which has a continuous sub form for line items. I allow a user to double click on the item number in the sub form to bring up a modal search form to look for items. If they find an item and double click it in the modal form, I insert the item in the invoice sub form and set the focus to the quantity field, then closes the modal form. that works fine.
Here is the complicated part that does not work.
Some special items when added to the sub form by direct keying or programmatic entry as I described above, cause additional processing triggered by the after update event on the item number field. One such item causes the automatic insert of a second item on the sub form. This is where the error occurs. When I issue the set focus, just before closing the modal form, I get a run time error 2110 "cannot move focus to the quantity control". If I select "end" from the debug dialog box, everything is inserted correctly the focus is on the item number of the first item of the continuous form. If I close the modal form manually, it's like everything worked fine except that the focus is on the first line item, item number field. The processing can continue as though there was no error from this point.