D
dennis g
Guest
I have a bit of code that writes an event log whenever a user updates a certain field. One the same form, there is a multiselect listbox where the user selects the different destinations the message will be printed to. I want to capture these selections and add them to the event log text, so I have proof of where a report was sent. My code so far:
Private Sub history_AfterUpdate()
Dim vItem As Variant
Dim evtTxt As String
Dim ctlList As Control
Set ctlList = Forms!nu_military!List63
For Each vItem In Me.List63.ItemsSelected
If Not IsNull(Me.List63.ItemData(vItem)) Then
'this is where I'm stuck' I need to enumerate 'the choices and grab all of them and store 'them in a string
End If
Next
If Not IsNull(event_log) Then event_log = event_log & vbCrLf
event_log = event_log & "This record was updated " & Now() & " by " & atCNames(1) & " " & evtTxt
End Sub
Any help is much appreciated.
Private Sub history_AfterUpdate()
Dim vItem As Variant
Dim evtTxt As String
Dim ctlList As Control
Set ctlList = Forms!nu_military!List63
For Each vItem In Me.List63.ItemsSelected
If Not IsNull(Me.List63.ItemData(vItem)) Then
'this is where I'm stuck' I need to enumerate 'the choices and grab all of them and store 'them in a string
End If
Next
If Not IsNull(event_log) Then event_log = event_log & vbCrLf
event_log = event_log & "This record was updated " & Now() & " by " & atCNames(1) & " " & evtTxt
End Sub
Any help is much appreciated.