-
Combobox change
I have a combobox whose list is populated from a database, and i want that everytime the user selects an item in the combobox, it modifies the recordsource of an adodc.
I set the combobox style to 2 (dropdownlist) because I dont want the user to alter its value.
The problem is that the Change event is never triggered, so how do I know the user selected an item. I thought of using a timer and checking periodically, but there must be a simple way !
Thx for help !
[edit] I know Validate is triggered when one leaves the control, but want the display to be refreshed even if the user doesnt leave the combo, like just hitting the up/down arrows. Example of this is in the windows display properties, when you select a screen saver, it displays it immediately.[/edit]
-
Try the click event.
I would keep the current value in a global var.
If is is the same as the previous you don't need to repopulate your adodc
-
funny.. I just added
Code:
Private Sub Cmb_World_Click()
Cmb_World_Change
End Sub
and it now works perfectly, even if i solely use keys, no mouse.
To save useless refreshes I used :
Code:
Private Sub Cmb_World_Change()
If Cmb_World <> sCurrWorld Then
sCurrWorld = Cmb_World
DoSomeStuff
End If
End Sub
thx for the tip :)