zimGirl
Geotechnical
- Jul 22, 2004
- 30
I have this code for my multiselect list box. If I select more than one item
the code goes through each of the items twice before it gets out.
If my list is:
Station
Apartments
Arena/Stadiums
Bingo Halls
If I select
Arena/Stadiums
Bingo Halls
It will loop through Bingo Halls twice before it goes to Arena/Stadiums, which it will do once.
How can I stop this from happening?
the code goes through each of the items twice before it gets out.
Code:
If lstCategory.ListIndex = -1 Then Exit Sub
For intCounter = lstCategory.ListCount - 1 To 0 Step -1
If lstCategory.Selected(intCounter) = True Then
Select Case lstCategory.ListIndex
Case 0 [COLOR=green]''Ambulance Stations[/color]
Call DrawFunction
Case 1 [COLOR=green]''Apartments[/color]
Call DrawFunction
Case 2 [COLOR=green] ''Arenas/Stadiums[/color]
Call DrawFunction
Case 3 [COLOR=green] ''Bingo Halls[/color]
Call DrawFunction
End Select
End If
Next intCounter
End If
If my list is:
Station
Apartments
Arena/Stadiums
Bingo Halls
If I select
Arena/Stadiums
Bingo Halls
It will loop through Bingo Halls twice before it goes to Arena/Stadiums, which it will do once.
How can I stop this from happening?