Solved

VB 6.0 ComboBox onchange

Posted on 2004-09-09
3
605 Views
Last Modified: 2013-12-25
Ola,

How do I know that the selectedIndex has changed from a VB 6.0 ComboBox, I am missing the needed events to do it.
Does someone know a workaround?

0
Comment
Question by:DaFou
  • 2
3 Comments
 
LVL 5

Assisted Solution

by:KarcOrigin
KarcOrigin earned 200 total points
ID: 12016487
Private Sub Combo1_Click()
    Debug.Print "I have changed"
End Sub
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 300 total points
ID: 12016507
Hi DaFou,

Use the ComboBox_Click() event rather than the Change event. The Change event fires when you enter in the text-edit section of a combobox which is not defined as a fixed list. The click event fires when one of the items is selected either using the keyboard or mouse as appropriate.

Tim Cottee
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 12016552
Hi,

Addition to my comment even if you change the ListIndex of the combo box the Click event fires.

Eg:
Combo1.ListIndex = 2

Ya TimCottee that is what I have shown DaFou in my first comment. Anyways, I hope we are helping him.

Keep the good work going on. Cheers!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now