Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention. Check out this how-to article for more information.
Function send_emailcap_mtd() On Error GoTo Err_Send_Click Dim mydb As Database, RS As Recordset Set mydb = DBEngine.Workspaces(0).Databases(0) Dim attachPDF As String Dim docname As String, ctl As Control, strTo As String Dim path As String, subject As String, body As String Dim attach As String, blnSuccessful As Boolean Application.Echo False Set RS = mydb.OpenRecordset("qry_emailcap_mtd") path = "c:\temp\" docname = "emailcap_mtd" attachPDF = path + docname & ".pdf" subject = "Email Address Capture Report" body = "Daily Report is Attached" DoCmd.OutputTo acOutputReport, docname, acFormatPDF, attachPDF Do Until RS.EOF strTo = RS!Email blnSuccessful = FnSafeSendEmail(strTo, subject, body, attachPDF, "", "") RS.MoveNext Loop RS.Close Set RS = Nothing Set mydb = Nothing exit_send_click: Application.Echo True Exit Function Err_Send_Click: Resume exit_send_click End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.