visual basic combo boxes

Kush

High On Life!
Joined
13 Jan 2002
Messages
4,590
hi guys i need help with something that might be simple to u.
i have two combo boxes the ones that u can add at runtime, and i have two options in each one for say bob and cob, i want to have if the user selects bob in the first combo box he cant select bob in the second one, therefore he would have to select cob, i tried doing it by adding and removing from the list but it messes up and adds to much of one or removes one thing, i also tried to do it if blahblah.text = bob then blahblah2.text >< bob. doesnt work that way either. thanks for your help.
 
put two combo boxes in a form and use this code;

Code:
Private Sub Combo1_Click()
If Combo1.Text = "bob" Then
Combo2.Clear
Combo2.AddItem "cob"
End If

If Combo1.Text = "cob" Then
Combo2.Clear
Combo2.AddItem "bob"
End If
End Sub

Private Sub Form_Load()
Combo1.AddItem "bob"
Combo1.AddItem "cob"
Combo2.AddItem "bob"
Combo2.AddItem "cob"
End Sub

is this what you are looking for?
 
yeah i think so. ill try it when i get home, thanks alot
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back