M
MSU Sptn
I created a list box sub form (thank you Allen Browne) where users can select
from a list of email addresses. The selected email addresses are then stored
on a list box (T_Mailing_List) in a separate form (Tasks scheduled). I have
a SendObject command in the code posted below to send emails to each email
address, but only the first email address in the list box (T_Mailing_List)
receives the email. Any suggestions?
--------
Sub SeparateEmails()
On Error GoTo Err_SeparateEmails
Dim strUser As Control
Dim strAct As Control
Forms![Tasks scheduled].Filter = "[AN_AutoNumber] = " & Me![AN_AutoNumber]
Forms![Tasks scheduled].FilterOn = True
Set strUser = [Form_Tasks scheduled].T_Mailing_List
Set strAct = [Form_Tasks scheduled].T_CompAct
DoCmd.SendObject acSendForm, "Tasks scheduled", "HTML (*.htm; *.html)",
strUser, "", "", "Please schedule: " + strAct, "See attached report for
details. Please reply to this message for schedule confirmation.", False, ""
Forms![Tasks scheduled].Filter = ""
Exit_SeparateEmails:
Exit Sub
Err_SeparateEmails:
MsgBox Err.Description
Forms![Tasks scheduled].Filter = ""
Resume Exit_SeparateEmails
End Sub
from a list of email addresses. The selected email addresses are then stored
on a list box (T_Mailing_List) in a separate form (Tasks scheduled). I have
a SendObject command in the code posted below to send emails to each email
address, but only the first email address in the list box (T_Mailing_List)
receives the email. Any suggestions?
--------
Sub SeparateEmails()
On Error GoTo Err_SeparateEmails
Dim strUser As Control
Dim strAct As Control
Forms![Tasks scheduled].Filter = "[AN_AutoNumber] = " & Me![AN_AutoNumber]
Forms![Tasks scheduled].FilterOn = True
Set strUser = [Form_Tasks scheduled].T_Mailing_List
Set strAct = [Form_Tasks scheduled].T_CompAct
DoCmd.SendObject acSendForm, "Tasks scheduled", "HTML (*.htm; *.html)",
strUser, "", "", "Please schedule: " + strAct, "See attached report for
details. Please reply to this message for schedule confirmation.", False, ""
Forms![Tasks scheduled].Filter = ""
Exit_SeparateEmails:
Exit Sub
Err_SeparateEmails:
MsgBox Err.Description
Forms![Tasks scheduled].Filter = ""
Resume Exit_SeparateEmails
End Sub