I need to send an email with 2 attachments...
Here is my code segment.
On Error GoTo Err_MailReport_btn_Click
Dim EmailSubject As String
Dim EmailBody As String
Dim DB As Database: Set DB = DBEngine(0)(0)
Dim RS As Recordset: Set RS = DB.OpenRecordset("TPPM Email List"
Dim Victim As Field: Set Victim = RS!EmailAddress
Dim stDocName As String: stDocName = "Month End Reports"
stEmailSubject = "Month End Reports"
email = Victim
RS.MoveNext
While RS.EOF = False
email = email + ";" + Victim
RS.MoveNext
Wend
DoCmd.SendObject acReport, stDocName, "SnapshotFormat(*.snp)", _
email, "", "", stEmailSubject, _
stEmailBody, False
Set Victim = Nothing
RS.Close: Set RS = Nothing
Set DB = Nothing
Exit_MailReport_btn_Click:
Exit Sub
Err_MailReport_btn_Click:
MsgBox Err.Description
Resume Exit_MailReport_btn_Click
End Sub
Here is my code segment.
On Error GoTo Err_MailReport_btn_Click
Dim EmailSubject As String
Dim EmailBody As String
Dim DB As Database: Set DB = DBEngine(0)(0)
Dim RS As Recordset: Set RS = DB.OpenRecordset("TPPM Email List"
Dim Victim As Field: Set Victim = RS!EmailAddress
Dim stDocName As String: stDocName = "Month End Reports"
stEmailSubject = "Month End Reports"
email = Victim
RS.MoveNext
While RS.EOF = False
email = email + ";" + Victim
RS.MoveNext
Wend
DoCmd.SendObject acReport, stDocName, "SnapshotFormat(*.snp)", _
email, "", "", stEmailSubject, _
stEmailBody, False
Set Victim = Nothing
RS.Close: Set RS = Nothing
Set DB = Nothing
Exit_MailReport_btn_Click:
Exit Sub
Err_MailReport_btn_Click:
MsgBox Err.Description
Resume Exit_MailReport_btn_Click
End Sub