Access 2010 - popup form to run routine on open
Posted on 2013-05-22
I have a main menu form with an option to 'update search database' that opens a popup form with a series of labels with tick boxes beside each label, plus a CANCEL button. Each label represents an update procedure that gets ticked as it is done. Eg. update client, update contacts, update notes, update jobs, etc.
At the end the popup form closes automatically.
I want the update series to run automatically on popup open, but I also want pressing CANCEL to stop process and close popup.
To get the update code to run automatically I tried calling it from the main form, after the docmo.open form.
So, instead of using:
This works fine unless the user wants to CANCEL during update procedure. The update code keeps running!
Any ideas of how I can get the functionality I want? TO recap, the popup needs to start update code automatically on form open, and close form when finished, but also allow user to CANCEL.
If I put the call to the update routine in the form open, load, activate, render, current event the update code runs, but the popup form never appears. The purpose of the popup form is to give the user an idea of where in the process it is, by seeing a tick against each label as it works through the list.