G
Guest
Maybe I'm just overlooking the obvious, but is there a way to format the text
in a text box once I've selected it with the following code. (I am putting
the names of employees in a text box to show which employees were selected
for a particular record. The names are appearing in a straight line and
separated by a comma, I would each name to have its own line in the text box.
)
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) & ","
Next varItem
If strList <> "" Then
strList = Left$(strList, Len(strList) - 1)
End If
Me.Employee = strList
End If
End With
Also, is there a way to "unhighlight" the multi select text box for the
next record (so nothing is highlighted for the next record). I am using a
single form view. Thank you.
in a text box once I've selected it with the following code. (I am putting
the names of employees in a text box to show which employees were selected
for a particular record. The names are appearing in a straight line and
separated by a comma, I would each name to have its own line in the text box.
)
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) & ","
Next varItem
If strList <> "" Then
strList = Left$(strList, Len(strList) - 1)
End If
Me.Employee = strList
End If
End With
Also, is there a way to "unhighlight" the multi select text box for the
next record (so nothing is highlighted for the next record). I am using a
single form view. Thank you.