Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.
Private Sub Command2_Click() If Len(Me!txtFileName & "") = 0 Then MsgBox "The AM Update has not been attached!!", , "Warning" Cancel = True Exit Sub End If Me.WaitMessage.Visible = True Dim rst As Recordset Set rst = CurrentDb.OpenRecordset("AllMembersLive") Do While Not rst.EOF DoCmd.Save Dim SEmailBody1 As String Dim SEmailBody2 As String Dim SEmailBody3 As String Dim SEmailBody4 As String Dim SEmailBody5 As String SEmailBody1 = "Email text - removed for privacy" SEmailBody2 = "Email text - removed for privacy" SEmailBody3 = "Email text - removed for privacy" Dim mess_body As String Dim appOutLook As Outlook.Application Dim MailOutLook As Outlook.MailItem Set appOutLook = CreateObject("Outlook.Application") Set MailOutLook = appOutLook.CreateItem(olMailItem) Set appOutLook = CreateObject("Outlook.Application") Set MailOutLook = appOutLook.CreateItem(olMailItem) With MailOutLook .BodyFormat = olFormatRichText .To = rst!Email .Subject = "Correlate Search - Weekly Update, " & Date .HTMLBody = SEmailBody1 & SEmailBody2 & SEmailBody3 If Left(Me.txtFileName, 1) <> "<" Then .Attachments.Add (Me.txtFileName) End If .DeleteAfterSubmit = True 'This would let Outlook send the note without storing it in your sent bin .Send End With 'MsgBox MailOutLook.Body 'Exit Sub rst.MoveNext Loop rst.Close Set rst = Nothing MsgBox "The AM Update has been sent!!", , "Success" Me.WaitMessage.Visible = False EH: If Err.Number = 2501 Then Err.Clear Resume Next End If End Sub