transfer button from one list box to another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a number of lists that I want to select from and transfer to one list
box. This will then be pasted in document any ideas how to do this?
 
Are you saying that you have multiple listboxes, and that from each of them
you will be selecting one or more items, and that all of the combined
selected items will then be put into another listbox? These are all on the
same form? If I have it right, I would have a button to copy all selected
items into the destination listbox. The destination listbox would have the
rowsource type set to value list (you provide the values, separated by
semicolons). In the button's event proc, I would define a string variable.
Set the string variable = vbnullstring. Then I would then loop thru each of
the listboxes' selected items, and append each value to the string variable,
putting a semicolon before the value (except for the first value). After all
listboxes have been processed, I would then set the rowsource for the
destination listbox to the value of the string variable, which would now have
all selected values from all other listboxes, separated by semicolons. And
then I would requery the destination listbox, so that it shows all of the
selected values.
 
Back
Top