-
I replace a combo box on my form ...
I want one event to trigger
When I chosee a different value from combo .
I write my code in "myCombo_Change()" event ...
but it is not triggered When I chosee a different value from combo .
it triggered when I write something to mycombo..
thanks
-
show me your code for on Change event
-
it just a message (yet)
it just a message (yet) as fallowing
msgbox "mycombo change"
but if I can take this message
I use if then
......
else
.....
end if
or select case
structure to do something more...
-
you have to put it under click not change because you are clicking the combo box and not change it got it
-
I understood you but....
I understood you but "click event" occurs even if I doesn't change combo box value.
-
Are you only chosing from the combo list?. If so then change the style property to '2-drop down list' and the click event 'will' fire when you choose an item.
-
thanks but....
I did what you said...
But still "click event" occurs even if
i doesn't change combo box value.
I can control change event in my code...
But I doesn't want to do that .
I want a event which only occure
when I choose different value then before in my combo...
example
my combo contains
item1
item2
item3
first item2 heve chosen
then I change to item3
my event must be triggered. (click event do it properly)
but when item2 is chosed from list again
my event mustn' be triggered. (click event occurs . But it
must not occur )
-
This is what I have done to avoid having the initial click fired when the text of the combo is set.
When you are initially populate the combo box set the tag property to what the text property will be
ex. dim search = 1 to 10
combo1.additem search
next search
combo1.tag = combo1.list(4)
combo1.text = combo1.list(4)
And the in the click event of the combo do a comparison
combo1_Click
if combo1.text <> combo1.tag then
'do what you want done as text has changed
end if
end sub