How to handle Click Event of ComboBox in VB 6 ?

I have got the following code written in Click event of ComboBox but never got executed when I'm clicking on the Combo Box

Private Sub cmbList1_Click()
msgbox "Entered Combo Click Event"
End Sub
nivaspramodAsked:
Who is Participating?
 
SethiCommented:
Yes that's the perfect way.
0
 
SethiCommented:
Use the change event:

Private Sub cmbList1_Change()
msgbox "Entered Combo Click Event"
End Sub
0
 
appariCommented:
click event fires when you select an item from the list.
change event fires when text is changed by typing in the text area of the combobox.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
hazgodCommented:
i always use the change event. otherwise, if you scroll instead of using dropdown and selecting the option, the click event won't happen.
0
 
nivaspramodAuthor Commented:
I got it working by using GotFocus and Validate events of the combobox. Actually the problem is to retain the value before i change the value in the combo box and once changed the value should be updated to the database. So, I tried Change and Click events of ComboBox to retain the value before changing the value.

 Let me know Is this the right way of doing it ?

 Storing  the old value once the Combo Box gets Focus and checking the value in the validate event whether current value is same as the old value or not.
0
 
SethiCommented:
Yes that the perfect way.
0
 
nivaspramodAuthor Commented:
"Storing  the old value once the Combo Box gets Focus and checking the value in the validate event whether current value is same as the old value or not."

is the right answer.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.