Message 1 of 7
Looping problem

Not applicable
05-03-2001
07:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Below is the code I have to remove selected items from a list box. The problem is that if you select more than one item, the last item selected always remains. I have tried different loops to accomplish this. Any help would be greatly appreciated.
Private Sub cmdRemoveFiles_Click()
On Error Resume Next
Dim i As Integer
For i = 0 To lstArchiveFiles.ListCount - 1
If lstArchiveFiles.Selected(i) = True Then
lstArchiveFiles.RemoveItem (i)
End If
Next i
End Sub
Thank You,
Jamie Gamauf
Private Sub cmdRemoveFiles_Click()
On Error Resume Next
Dim i As Integer
For i = 0 To lstArchiveFiles.ListCount - 1
If lstArchiveFiles.Selected(i) = True Then
lstArchiveFiles.RemoveItem (i)
End If
Next i
End Sub
Thank You,
Jamie Gamauf