3
votes

I have a modal/pop-up form frmEditContact open

on this form there is a combo box full of addressescmbAddressList, populated by a query. when the user wants to add an address that doesn't exist there is a button that opens the frmAddress where they may add an address.

frmAddress allows them to enter an address to the list and gives the option to save, or cancel (both actions close the form after). with this form closed, the focus is now again on frmEditContact

I would like to repopulate the combo box using docmd.Requery cmbAddressList after they close the other form

I'm not sure where to handle this, I've tried On Avtivate, On Load, On Update, On Open, On Focus...but none of them fire as I keep the frmEditContact open when they are using the other form

is there a way to keep frmEditContact open the whole time, but still an action Event that will fire so that I can Requery? And does On Activate not work with modal forms?

2

2 Answers

1
votes

You can requery the combo from frmAddress :

Forms!frmEditContact.cmbAddressList.Requery

I suggest you use the save button to run the requery.

1
votes

Try this in your frmEditContact code.

DoCmd.OpenForm "frmAddress", acNormal, WindowMode:=acDialog
Me.cmbAddressList.Requery

Since frmAddress is opened in dialog mode, the next line (Requery) will not run until after frmAddress is closed.