transfer data from one listbox to another

chowchow123

Active member
Joined
Sep 6, 2007
Messages
34
Programming Experience
1-3
Hi

I have two listboxes bounded to two different db tables. Both display mem id from the respective tables. I want to add a selected mem id from listbox 1 to listbox 2 and transfer the data (row) associated with the particular mem id

I tried to do this using a button and the code below

Dim i As Integer
While trialmemListBox.SelectedIndices.Count > 0
fullmemListBox.Items.Add(trialmemListBox.SelectedItems(i))
End While

but I get the following error

Items collection cannot be modified when the DataSource property is set.

cheers
 
Back
Top