Originally posted by Sham81
okay... how does that work? Does anyone have an example of it?
In this example I have used two listboxes, one called lst1 and the other lst2. All I'm doing is moving the selected items from one list to the other. You would need other code to clear the listboxes as needed.
Add this to your OK button but set the lst1 and lst2 listbox names to what you call yours.
Dim strValue As String, varItem As Variant
If lst1.ItemsSelected.Count = 0 Then
MsgBox "There are no items selected"
For Each varItem In lst1.ItemsSelected
lst2.AddItem lst1.Column(0, varItem)
You need to add two list boxes to a form and set certain properties for each. Set the RowSourceType to coorespond with what your source of data is going to be. If it will be a table or query, set it to "Table/Query" and if adding manually with code, set it to value list. The other important property is the Multi Select property. Set this to Simple or Extended to allow multiple selections at one time. The only difference is the way you select them. See the help files for more details.