limobill
asked on
Email Multiple Query Lines in the Body of an Email with Access
I need to send query results to specific individuals (The recipients will not change). I need to send a query and would like multiple lines to appear in the email body. I've attach some code that works but just returns the first line of the query. Thanks
Private Sub button_email_Click()
Dim db As Database
Dim rs As Recordset
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set db = CurrentDb
Set rs = CurrentDb.OpenRecordset("qryEmail_IRs")
Recipient = "jdoe@yahoo.com"
With MailOutLook
.To = Recipient
.Subject = "Incident Report"
.Body = rs!TripID & " " & rs!Booker
.DeleteAfterSubmit = True
.Send
End With
Set MailOutLook = Nothing
Set appOutLook = Nothing
Exit Sub
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Worked perfectly
ASKER