[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to handle Click Event of ComboBox in VB 6 ?

Posted on 2003-11-05
7
Medium Priority
?
432 Views
Last Modified: 2013-12-26
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
0
Comment
Question by:nivaspramod
7 Comments
 
LVL 18

Expert Comment

by:Sethi
ID: 9686006
Use the change event:

Private Sub cmbList1_Change()
msgbox "Entered Combo Click Event"
End Sub
0
 
LVL 39

Expert Comment

by:appari
ID: 9686308
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
 
LVL 1

Expert Comment

by:hazgod
ID: 9691865
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:nivaspramod
ID: 9706575
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
 
LVL 18

Expert Comment

by:Sethi
ID: 9706653
Yes that the perfect way.
0
 
LVL 18

Accepted Solution

by:
Sethi earned 375 total points
ID: 9706654
Yes that's the perfect way.
0
 

Author Comment

by:nivaspramod
ID: 9721835
"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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month18 days, 7 hours left to enroll

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question