[RESOLVED] Hel with listboxes needed
People I have with me 2 listboxes(8 options) each having the same option at same index.
I want to avoid the possibility of same option being selected from both lists.
Its like team 1 vs team 2 so you probably get the idea right.
There are 8 teams.
I have no idea as to how to code this, so please help.
Re: Hel with listboxes needed
Hope this helps
Code:
Private Sub Command1_Click()
If List1.ListIndex = List2.ListIndex Then
'if both of them have the same selection
MsgBox "selection not allowed"
End If
End Sub
Re: Hel with listboxes needed
try something like this... with 2 listbox
Code:
Private Sub Form_Load()
For i = 1 To 8
List1.AddItem "Team " & i
List2.AddItem "Team " & i
Next
End Sub
Private Sub List1_Click()
If List1.ListIndex = List2.ListIndex Then
MsgBox "same team selected"
End If
End Sub
Private Sub List2_Click()
If List1.ListIndex = List2.ListIndex Then
MsgBox "same team selected"
End If
End Sub
hope u tried the samething with option button in another post is it? but there i cudnt get u, now i hope u got the idea for option button also...
Re: Hel with listboxes needed
WORKS!!!!!!!!!!!!!!!!!!!!;):D:cool::wave::check: