clearing out a list

E

Eric

This code doesn't seem to work; I'm expecting my list to look empty after
runnign it but it doesn't.

Dim iCount As Long
' clear it out first
If aTargetLst.ListCount > 0 Then
For iCount = 0 To aTargetLst.ListCount
If Not IsNull(aTargetLst.ItemData(iCount)) Then
aTargetLst.RemoveItem (iCount)
End If
Next iCount
aTargetLst.Requery
End If

TIA,
Eric
 
A

Alastair MacFarlane

Eric

I am in a rush but every time I manipulate a listbox I
have had to use the ListIndex proprty to hook into the
particular listbox entry. Try using this rather than
looping through the counted items in the list.

Sorry to be vague but I am in a rush.

Alastair MacFarlane
 
Top