E
Eric
I know alot of you have done this before.
I just want to transfer items selected from one list to another, but am not
sure how to handle the columns.
Both listboxes are two columns with column 1 bound. The id for the record is
hidden in column(0) and the display string in column(1). So far, I have this
on clicking the transfer button:
Private Sub cmdAssignSelected_Click()
' this will only be enabled if there are items selected
Dim varItem As Variant
For Each varItem In lstUnassignedPeople.ItemsSelected
lstAssignedPeople.AddItem varItem
lstUnassignedPeople.RemoveItem varItem
Next varItem
varItem has the index of the selected item; I get that much. AQnd I can see
the values I want by doing this in debug window:
?lstUnassignedPeople.Column(1, varitem)
Bozich, Karen ' the display string
?lstUnassignedPeople.Column(0, varitem)
56 ' her employee id
My question is are AddItem and RemoveItem any good here? How do I
populate/remove the columns in each box?
Sorry if this seems too obvious.
TIA,
Eric
I just want to transfer items selected from one list to another, but am not
sure how to handle the columns.
Both listboxes are two columns with column 1 bound. The id for the record is
hidden in column(0) and the display string in column(1). So far, I have this
on clicking the transfer button:
Private Sub cmdAssignSelected_Click()
' this will only be enabled if there are items selected
Dim varItem As Variant
For Each varItem In lstUnassignedPeople.ItemsSelected
lstAssignedPeople.AddItem varItem
lstUnassignedPeople.RemoveItem varItem
Next varItem
varItem has the index of the selected item; I get that much. AQnd I can see
the values I want by doing this in debug window:
?lstUnassignedPeople.Column(1, varitem)
Bozich, Karen ' the display string
?lstUnassignedPeople.Column(0, varitem)
56 ' her employee id
My question is are AddItem and RemoveItem any good here? How do I
populate/remove the columns in each box?
Sorry if this seems too obvious.
TIA,
Eric