Murray Brown
asked on
Access VBA - send query
Hi
How do I update the following code so that the query gets sent in the body of the email.
Also it doesn't get sent automatically. I have to press the send button. I don't want to have to.
How do I update the following code so that the query gets sent in the body of the email.
Also it doesn't get sent automatically. I have to press the send button. I don't want to have to.
Sub SendDatesEntered(ByVal sEmail As String)
On Error GoTo EH
DoCmd.SendObject acSendQuery, "Dates Entered in Performance", acFormatPDF, sEmail, "graham@ses-sa.co.za", "admin@macros-vba.com", "Lesedi Performance dates entered", "These are the dates entered into the Performance database", , True
Exit Sub
EH:
'MsgBox "There was an error sending a report " & Err.Description
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
Thanks very much Jeff
;-)
DoCmd.SendObject acSendQuery, "Dates Entered in Performance", acFormatPDF, sEmail, "graham@ses-sa.co.za", "admin@macros-vba.com", "Lesedi Performance dates entered", "These are the dates entered into the Performance database", , False
...But the help files on the SendObject Method explains all of these options...
Embedding the query IN the body of the email takes a bit more work.
I'm at the office now, I am sure another Expert can help with that portion of your Q
;-)
JeffCoachman