VB6 Combo Box Change Event

When user selects an item in a combo box, I would like to respond with a subroutine that does something with the new choice.

I put a break in the code written under subroutine "ComboBox_Change", but the program doesn't seem to call that subroutine when a new selection is made in the combo box.

I've temporarily installed a "GO" command button and put the code there, but that requires the user to do one extra mouse click.

The action should take place whenever a new selection is made in the combo box itself.

What am I missing here?
Norma PosyPhysicistAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Try the Click event.
Norma PosyPhysicistAuthor Commented:
But there are two clicks.
First, to get the drop-down of the items.
Second, to select the item.

Anyway, I'm curious. What event actually triggers the "change" event?
Martin LissOlder than dirtCommented:
Of the two "clicks" the first triggers the DropDown event and selecting the item triggers the Click event. Note that the Click event is also generated when the combobox is loaded and I added code to ignore that. The Change event is triggered when you type a value into the combobox and I don't think I've ever found a use for that event.

I've attached a demo project that illustrates the above. It includes displaying some messages in the Immediate Window because otherwise they would get in the way of normal processing.
Project1.zip

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Norma PosyPhysicistAuthor Commented:
Thank you so much.
You have clarified the combo box "click" and "change" events for me.
- - Norma
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.