Run Code within code.. Newbie Question

ezykiwi

Registered User.
Local time
Today, 20:51
Joined
Sep 5, 2006
Messages
33
Howdy All, Im hoping someone might be able to please help me...

Ive got code so that when a combo box is updated the code runs,

Private Sub combo1_AfterUpdate()

Which works fine, but Ive also got a button, which updates the value of that combo box, and I need to get that button to run the afterupdate when its pressed, Im just wondering what the best way of doing this is, is there some way i can call the afterupdate code to start, or should it already be starting when the value of the combo box changes anyway......

The code im using on my button is just
Me.combo1.Value = 4

Any help would be awesome....
Cheers Ezy
 
setting the value of a commbo box externally wont fire the after update event. the after update only fires if you make a selection IN the compbo box. therefore you are OK running the after event code directly.
 
gemma-the-husky said:
setting the value of a commbo box externally wont fire the after update event. the after update only fires if you make a selection IN the compbo box. therefore you are OK running the after event code directly.

Thanks for the quick reply Gemma,

So is there some way I can code into my button to run the afterupdate code of the combobox?

Cheers Ezy
 
Just use this in the code of your button, after you do everything else:

call combo1_AfterUpdate()
 
Last edited:
Awesome, thanks mate, that works great,

Cheers... Ezy
 

Users who are viewing this thread

Back
Top Bottom