when i change the contents of combo box at run time using additem, any code thats in the combo1_click sub gets ran. How do i stop this? any help would be great
Printable View
when i change the contents of combo box at run time using additem, any code thats in the combo1_click sub gets ran. How do i stop this? any help would be great
Hmm, declare a boolean variable at the top of your form, call it boolStopClickEventRunning
then enclose all the code in your clickevent in an if statement like this
then when you add an item do it like thisCode:Private Sub Combo1_Click()
If Not boolStopClickEventRunning Then
'your click code here
End If
Hope this helpsCode:boolStopClickEventRunning = True
Combo1.AddItem MyItem
boolStopClickEventRunning = False
thanx, that did help