Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On activate does not fire with my Modal/Pop-Up form to Requery

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?

like image 831
Odesmere Avatar asked Jan 01 '26 21:01

Odesmere


2 Answers

You can requery the combo from frmAddress :

Forms!frmEditContact.cmbAddressList.Requery

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

like image 102
Fionnuala Avatar answered Jan 04 '26 12:01

Fionnuala


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.

like image 28
HansUp Avatar answered Jan 04 '26 12:01

HansUp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!