I have a form that does multi duty. When the user inputs to a combo box and the item is not in the list the NotInList fires and opens an entry form for the new item. While passing to the new item entry form I also reconfigure my current form with the anticipation of a successful new item entry. Oh but then the user presses Cancel in the new item entry form and i have a reconfigured form that I need to change back. The new item form in its Cancel button click passes to the main form a True value to a hidden textbox called NewItemFail on the main form. My question is what event fires on the main form when the focus is passed back to it from the new item entry that is closing so that I can test this NewItemFail textbox and take the necessary action? I have tried OnGotFocus which didn't work even though the entry form's cancel implicitly sets focus back to the main form and now read that the OnActivate event does not fire between forms. So what does fire? Or must I do all my main form reconfiguration from the item entry cancel event? (Bleh, all of my config routines are private within the main form code.)
Code:
Private Sub cmdCancel_Click()
With Me
If .txtCallingForm = "frmItemCrafted" Then
Forms(.txtCallingForm).txtNewItemFail = 1
End If
Forms(.txtCallingForm).SetFocus
DoCmd.Close acForm, .Name
End With
End Sub