Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Force AfterUpdate?

Status
Not open for further replies.

TommyIndigo

Programmer
Sep 14, 2000
67
US
I have a form with a combo box that has an elaborate routine for its AfterUpdate event. At certain times, I would like to open this form programatically and specify a value for the combo box. I can do this by assigning the value in VBA, however the AfterUpdate event is not triggered. I've tried Repaint and Requery with no success.

Is there a way I can programatically run the AfterUpdate event on the combo box once I change its value?

Any help would be MOST appreciated!
 
Hi TommyIndigo

I assume by saying "open this form programatically" you do this from another form.

Make the AfterUpdate event of the Combo a Public Sub:

Private Sub TheComboName_AfterUpdate()

After the line of code that specifies the value for the Combo:

Forms!FormName.TheComboName_AfterUpdate

FormName is the name of the form with the combo on.

Bill


 
or after the value is set just type in
Call (name of code)

works for me
 
Hi RamziSaab,

That's perfect if the code is being run from the same form.

TommyIndigo has talked about "open this form programatically" which suggests the combo is being updated from somewhere other than the form with the combo afterupdate sub.

Good Luck

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top