Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / November 2005



Tip: Looking for answers? Try searching our database.

Combo box's _Change method not activating

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aaa - 19 Nov 2005 21:41 GMT
I created a combo box, double clicked it and added

MsgBox "Hello"

in the myCombo_Change() Sub. However, when I run the program and change the
selection in the combo box I don't get any message saying "Hello". Why is
this Sub not run?
MikeD - 19 Nov 2005 23:34 GMT
>I created a combo box, double clicked it and added
>
[quoted text clipped - 4 lines]
> selection in the combo box I don't get any message saying "Hello". Why is
> this Sub not run?

MsgBox frequently interferes with events. Don't use it for debugging
purposes. Instead, use Debug.Print to print to the Immediate window.

But that's probably not the problem you're having. A combobox's Change event
fires ONLY when text in the edit portion of the combobox is changed. Use the
Click event for when the user selects an item from the dropdown portion of a
combobox.

Signature

Mike
Microsoft MVP Visual Basic

aaa - 20 Nov 2005 08:25 GMT
Thanks Mike!

However, I haven't learnt that much about VB yet. I just know how to add an
event handler to a control by double clicking the control. How do I add a not
default event handler to a control?

Regards,
Joachim

> >I created a combo box, double clicked it and added
> >
[quoted text clipped - 12 lines]
> Click event for when the user selects an item from the dropdown portion of a
> combobox.
aaa - 20 Nov 2005 08:37 GMT
I found out.

> Thanks Mike!
>
[quoted text clipped - 21 lines]
> > Click event for when the user selects an item from the dropdown portion of a
> > combobox.
aaa - 20 Nov 2005 08:37 GMT
I found out.

I used

Private Sub cbTypeOfPositionStream_Click()
   Debug.Print "Hello"
End Sub

but it still didn't print anything or show any window.

Regards,
Joachim

> Thanks Mike!
>
[quoted text clipped - 21 lines]
> > Click event for when the user selects an item from the dropdown portion of a
> > combobox.
aaa - 20 Nov 2005 08:45 GMT
Ok... I found the immediate window...

> I found out.
>
[quoted text clipped - 34 lines]
> > > Click event for when the user selects an item from the dropdown portion of a
> > > combobox.
MikeD - 20 Nov 2005 12:12 GMT
I'm not trying to be rude or unsympathetic, but you really need to just
spend some time with VB read its Help, and get familiar with it. If you
continue asking here about every little "problem" and then post a couple
minutes later that you "found out" on your own, you're going to quickly
annoy people who will then be reluctant to help you when you really need it.
Just a friendly heads-up.

Signature

Mike
Microsoft MVP Visual Basic

> Ok... I found the immediate window...
>
[quoted text clipped - 43 lines]
>> > > portion of a
>> > > combobox.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.