clearing out a list

  • Thread starter Thread starter Eric
  • Start date Start date
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top