Hello All, I have two multi-select listboxes, 'listFrom' and 'listTo'. I want to be able to copy mulitple selections from 'listfrom' to 'listTo' and delete those selections from 'listfrom'.
To copy over multiple items is no problem but when i introduce the 'removeitem' line to delete the selection, it deletes only the first selection encountered and exits the loop - In debug mode, after it deletes the item in current index, it deselects the other items selected and in the next run of the loop finds no selected item and it just exits. Below is the code i am working with - Any help with this will be much appreciated!:
----------------------------------------------------------
Dim i As Long
Dim lstCount As Long
lstCount = lstFrom.ListCount - 1
For i = lstCount To 0 Step -1
If lstFrom.Selected(i) = True Then
'Add to default list
lstTo.AddItem lstFrom.Column(0, i)
'Remove item from source list
lstFrom.RemoveItem i
End If
Next i
---------------------------------------------------------------
I forgot to mention, the final application will be run on Access 2003 and above ... i have referenced other sources that use the ".list" function e.g. 'lstTo.Additem lstFrom.list(i)' which seems to be absent under this version of access.