Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Constantly Check Text Of Combobox (http://www.programmingforums.org/showthread.php?t=1466)

mfo6463 Dec 7th, 2004 11:42 PM

I have a combobox with "Option1" and "Option2"
When Option1 is clicked, option1 is enabled and option2 is disabled, and when Option 2 is clicked, it is enabled and Options1 is disabled.
The problem is that it only works for the first time. When you click the opposite option the second time, nothing happens. How do I get it to constantly check what choice.text is?
:

Sub choice_Click()

If choice.Text = "Option 1" Then
option1.Enabled = True
option2.Enabled = False

ElseIf choice.Text = "Option 2" Then
option1.Enabled = False
option2.Enabled = True

End If
End Sub


Ooble Dec 8th, 2004 1:46 PM

Try using Sub choice1_Change().

Pizentios Dec 8th, 2004 2:23 PM

Yeah _Change() will work for you.

mfo6463 Dec 8th, 2004 4:41 PM

Quote:

Originally posted by Ooble@Dec 8 2004, 01:46 PM
Try using Sub choice1_Change().
Is there something else I need to add for it to know that it changed, because that doesnt work with what I have...

Pizentios Dec 8th, 2004 5:46 PM

it could be:

:

Private Sub Choice1_Change()

mfo6463 Dec 8th, 2004 9:28 PM

I have no idea why, but now it works with choice_Click and not with choice_Change. Oh well, at least it does what I want it to do.

Ooble Dec 9th, 2004 3:55 PM

There's Microsoft for ya. :P


All times are GMT -5. The time now is 4:02 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC