• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

visual basic combo boxes

Kush

High On Life!
#1
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.
 
#2
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?
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,016
Latest member
ernestrojasn