While you can pass variable information INTO another Form (for example, when you click a button to open a Form, you could pass information), you can't really return anything back the other way.
In this instance, however, I think we can simulate it by just having the OK button on your popup Form perform the Requery on your main Form.
The following code snippit makes several assumptions:
- Your main Form is called frmSwitchboard.
- Your popup form is called frmAddRec.
- The "OK" Button on frmAddRec is called btnOK.
- You only call frmAddRec from frmSwitchboard.
Example code:
Code:
Private Sub btnOK_Click
Forms!frmSwitchboard.Requery
DoCmd.Close acForm, Me.Form.Name
End Sub
If you happen to open frmAddRec from multiple "main" Forms, you can still do it, but the Requery portion of the code is a little more complex.