Goal:
I have a field which holds multiple values (initials of Employees assigned to a specific item). This is displayed on a report as a list box. So it will have column of checkboxes, either checked or unchecked, showing who is assigned to that particular item. The report is grouped into different instances of these items.
What I want to do is for each instance of an item, display a textbox with a string displaying the Initials of employees assigned to that item, not all employees. So I wrote this code in a Format event for that grouping:
Code:
'***DEBUG
MsgBox ("TEST 123 for RMA: " & txtRMA.Value)
'***DEBUG
Dim varItem As Variant
Dim strInitials As String
Dim lngLen As Long
With lstEmplAssigned
For Each varItem In .ItemsSelected
If Not IsNull(varItem) Then
'build a string containing the initials, separated by commas
strInitials = strInitials & .ItemData(varItem) & ", "
End If
Next
End With
'Remove trailing comma.
lngLen = Len(strInitials) - 2
strInitials = Left$(strInitials, lngLen)
'Set the textbox to show the initials
txtEmplAssigned.Value = strInitials
My problem is, nothing is happening, not even the message boxes. Where am I going wrong?