M
Michelle
I have the following code that allows the user to select items in a list box
and show them in a text box. However, if the user comes back to a record and
wants to add additional names to the text box, it clears out the previous
selection.
Here is my code:
Dim varItem As Variant
Dim strList As String
With Me.Employee
If .MultiSelect = 0 Then
Me.Employee = .Value
Else
For Each varItem In .ItemsSelected
strList = strList & .Column(0, varItem) & vbCrLf
.Selected(varItem) = False 'unselect listbox
Next varItem
If strList <> "" Then
strList = Left$(strList, Len(strList) - 1)
End If
Me.Employee = strList
End If
End With
Can anyone help with the code of adding additional employees to the text box
while keeping any original employees previously selected. Thanks.
and show them in a text box. However, if the user comes back to a record and
wants to add additional names to the text box, it clears out the previous
selection.
Here is my code:
Dim varItem As Variant
Dim strList As String
With Me.Employee
If .MultiSelect = 0 Then
Me.Employee = .Value
Else
For Each varItem In .ItemsSelected
strList = strList & .Column(0, varItem) & vbCrLf
.Selected(varItem) = False 'unselect listbox
Next varItem
If strList <> "" Then
strList = Left$(strList, Len(strList) - 1)
End If
Me.Employee = strList
End If
End With
Can anyone help with the code of adding additional employees to the text box
while keeping any original employees previously selected. Thanks.