|
-
Sep 8th, 2000, 10:14 AM
#1
Thread Starter
New Member
I've got a listbox (lstLeft) that stores 10 possible values. I've got a recordset that returns those that match for the corresponding agent. So I might have one that matches and I might have more.
I'm trying to write code that will loop through the ItemData of the items in lstLeft, if it matches, move the item from lstLeft to lstRight, so that all matching values for the selected agent will appear when I edit his/her file.
Problem is, my ListIndex value keeps coming up with a value of -1. My code is shown below...any thoughts? Is there a better way to tackle what I'm trying to accomplish?
Do While Not objRS.EOF
If lstLeft.ItemData(i) = objRS("ID") Then
lstRight.AddItem lstLeft.Text
lstRight.ItemData(lstRight.NewIndex) = lstLeft.ItemData(i)
lstLeft.RemoveItem lstLeft.ListIndex
Else
i = i + 1
End If
Loop
 TM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|