I have a main form that has a combo box. If an item is not in the combo box list, you double click it and it opens a pop up form to add the info. The pop up form has an On Close event that requeries the combo box on the main form so that the item will show up in the list.
Private Sub Form_Close()
Forms!MainFormName.ComboBoxName.Requery
End Sub
That part works.
My problem is that I actually have 6 main forms that have the identical combo box that I want to open a single pop up form. Since the On Close event of the pop up form refers to a specific form name I would need 6 pop up forms to accomplish this. Is there a way to word it so that it requeries whatever form is open at that time?
ASKER
I think my problem is that I do not understand the first part of your instruction:
"include an OpenArg (the last argument) in the Docmd.OpenForm method which indicates the name of the form that called the popup."
where, how, what?? - sorry but I am unclear on what this means and what I do with it.
Currently when you double click the drop-down it opens the pop up form:
Private Sub AnalystId_DblClick(Cancel As Integer)
DoCmd.OpenForm "AddAnalyst"
End Sub
I think you mean I need to add something here?