I'm trying to transfer records from one listview control to another. Here's the logic:
Dim itmX as listItem
For Each itmX In lvwGrps.ListItems
If itmX.Selected = True Then
PopulateGroupAdd itmX.Text, itmX.SubItems(1)
lvwGrps.ListItems.Remove itmX.Index
End If
Next
Problem:
It will populate the 2nd listview and delete the record from the 1st listview, but as it goes to the next record, I'm receiving an error that states: "Controls collection has been modified"
This would be the lvwGrps.listitems collection and then I receive "For loop not initialized"
I've tried various ways and can't seem to get all records to work properly. The user must be able to muli-select records for this transfer.
Any assistance is greatly appreciated!
Dim itmX as listItem
For Each itmX In lvwGrps.ListItems
If itmX.Selected = True Then
PopulateGroupAdd itmX.Text, itmX.SubItems(1)
lvwGrps.ListItems.Remove itmX.Index
End If
Next
Problem:
It will populate the 2nd listview and delete the record from the 1st listview, but as it goes to the next record, I'm receiving an error that states: "Controls collection has been modified"
This would be the lvwGrps.listitems collection and then I receive "For loop not initialized"
I've tried various ways and can't seem to get all records to work properly. The user must be able to muli-select records for this transfer.
Any assistance is greatly appreciated!