Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 7th, 2004, 10:42 PM   #1
mfo6463
Newbie
 
Join Date: Nov 2004
Posts: 10
Rep Power: 0 mfo6463 is on a distinguished road
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
mfo6463 is offline   Reply With Quote
Old Dec 8th, 2004, 12:46 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Try using Sub choice1_Change().
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Dec 8th, 2004, 1:23 PM   #3
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Yeah _Change() will work for you.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Dec 8th, 2004, 3:41 PM   #4
mfo6463
Newbie
 
Join Date: Nov 2004
Posts: 10
Rep Power: 0 mfo6463 is on a distinguished road
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...
mfo6463 is offline   Reply With Quote
Old Dec 8th, 2004, 4:46 PM   #5
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
it could be:

Private Sub Choice1_Change()
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Dec 8th, 2004, 8:28 PM   #6
mfo6463
Newbie
 
Join Date: Nov 2004
Posts: 10
Rep Power: 0 mfo6463 is on a distinguished road
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.
mfo6463 is offline   Reply With Quote
Old Dec 9th, 2004, 2:55 PM   #7
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
There's Microsoft for ya.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:02 AM.

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