|
-
Nov 29th, 2000, 04:07 AM
#1
Thread Starter
Addicted Member
Hi All,
I am trying to remove an item from one list and place it into another. I keep getting a "Invalid property array index" error. I know that if I set iCount to iPos = iCount - 2 it will work but it moves the item that is two places above it out of the list.
Can anyone Help / Advise me PLEASE?
Private Sub cmdRemoveHighlighted_Click()
Dim iCount As Integer
Dim iPos As Integer
iPos = 0
'Total count of list items on RHS
iCount = lstQueryList.ListCount
'Loop through the list
C = iCount - 1
For iPos = 0 To C
' MsgBox lstQueryList.List(iPos)
If lstQueryList.Selected(iPos) Then
'Add item to LHS list
lstAllData.AddItem (lstQueryList.List(iPos))
'Remove Selected item on list
lstQueryList.Selected(iPos) = False
lstQueryList.RemoveItem (lstQueryList.Selected(iPos))
fraData.Refresh
End If
Next iPos
End Sub
Thanks in advance,
Rocks
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
|