M
MSU Sptn2
I would like to list the items selected in a multi-select list box in a table
field. I have a list box displaying email addresses and I would like to
enter the selected addresses to a table field separated by a semicolon so
when my SendObject command references the table field, it will send the email
to all addresses in the field. I have the following code, but it just
inserts NA to everything. I am new at this and I can't find the problem.
Any suggestions?
Dim i As Integer
Dim var As Variant
Dim strEmails As String
If lstProgram_Manager.Selected(i) = True Then
For Each var In Me.lstProgram_Manager.ItemsSelected
strEmails = strEmails & Me.lstProgram_Manager.Column(1, var) & ";"
Next var
CurrentDb.Execute "UPDATE TblCompliance SET T_Reminder_Mailing_List='" &
strEmails & "' WHERE AN_AutoNumber = " & Me!txtAN_AutoNumber
ElseIf lstProgram_Manager.Selected(i) = False Then
CurrentDb.Execute "UPDATE TblCompliance SET T_Reminder_Mailing_List='" &
"NA" & "' WHERE AN_AutoNumber = " & Me!txtAN_AutoNumber
End If
field. I have a list box displaying email addresses and I would like to
enter the selected addresses to a table field separated by a semicolon so
when my SendObject command references the table field, it will send the email
to all addresses in the field. I have the following code, but it just
inserts NA to everything. I am new at this and I can't find the problem.
Any suggestions?
Dim i As Integer
Dim var As Variant
Dim strEmails As String
If lstProgram_Manager.Selected(i) = True Then
For Each var In Me.lstProgram_Manager.ItemsSelected
strEmails = strEmails & Me.lstProgram_Manager.Column(1, var) & ";"
Next var
CurrentDb.Execute "UPDATE TblCompliance SET T_Reminder_Mailing_List='" &
strEmails & "' WHERE AN_AutoNumber = " & Me!txtAN_AutoNumber
ElseIf lstProgram_Manager.Selected(i) = False Then
CurrentDb.Execute "UPDATE TblCompliance SET T_Reminder_Mailing_List='" &
"NA" & "' WHERE AN_AutoNumber = " & Me!txtAN_AutoNumber
End If