Email a report from access

R

Rtash

Hello,
Is it possible to program a command button in a form to email a report to a
single email address with just one click of said button? I would like it to
operate similar to a print report button.
Thanks,
Rusty
 
W

Wayne-I-M

Hi RTash

You can used the send object method. If you should search on access help it
will give you a "run though". The code behind the OnClick event would look
something like this

DoCmd.SendObject acReport, "REPORTNAME", "RichTextFormat(*.rtf)",
Forms!FORMNAME!EMAIL ADDRESS, Forms!FORMNAME!EMAILADDRESS-CC, "", "EMAIL
SUBJECT", "EMAIL CONTENT", False, ""


Notes
"RichTextFormat(*.rtf)" - this would format the report as RTF for Word Doc
but there are other formats such as excel, etc

Forms!FORMNAME!EMAIL ADDRESS - this is the main e mail address the report
will be sent to

Forms!FOEMNAME!EMAILADDRESS-CC - this is used if you want to send a copy of
the report to other address at the same time

"EMAIL SUBJECT" - Insert text between the quotes that you want to apprear in
the Subject line of the email

EMAIL CONTENT" - insert text here that you want to apprear at the top of
the main body of the e mail.

Hope this helps


--
Buon Natale, Happy Chritmas.

Wayne
Manchester, England.
Scusate,ma il mio Inglese fa schiffo :)
Percio se non ci siamo capiti, mi mandate un
messagio e provero di spiegarmi meglio.
 
Top