Timing of Events

catbeasy

Registered User.
Local time
Today, 14:42
Joined
Feb 11, 2009
Messages
140
I have a drop down box that once selected, populates some data in a sub form.

Some controls in the main form control's source are set to the values in the sub form.

What I would like to do is, after making a selection from the drop down box and AFTER those controls populate, have a msgbox pop up.

What I've tried to do, unsuccessfully, is put the msgbox code in the After Update events of both the drop down box and one of the controls (a text box that whose control source is a field in the subform). Neither works.

In the After Update event of the drop down box, the msgbox comes up before the controls populate (a la the results of the drop down box).

If the code is in the After Update event of the text box control, nothing happens..

Any suggestions? The user needs to see the data populate in those controls before they can respond to the msgbox..
 
You can't use the textbox after update event, as it won't fire when you change the value with code. You might try a DoEvents in the combo code after updating controls but before the message box, to see if that gives everything time to fill in.
 
You can't use the textbox after update event, as it won't fire when you change the value with code. You might try a DoEvents in the combo code after updating controls but before the message box, to see if that gives everything time to fill in.
unfortunately, the DoEvents didn't work. Any other suggestions? Am I forced to create a new button that the user has to click to continue?
 
What does your code look like? Can you post the db?
 
When you populate a textbox thru code, as Paul said, the AfterUpdate event of the textbox doesn't execute automatically. But you can always simply call the AfteUpdate sub from code, immediately after doing the data assignment, using syntax like this:

YourTextBox_AfterUpdate
 

Users who are viewing this thread

Back
Top Bottom