E-Mail Access report (1 Viewer)

Glen

New member
Local time
Today, 05:01
Joined
Jul 12, 2000
Messages
8
I need to distribute a weekly report via e-mail to a list of users. The report has some fairly complex formatting which tends to get lost when I export to excel for onward e-mailing.
Is there any way I can e-mail the report direct from Access (either 97 or 2000) ??
Your help is much appreciated.
 

Talismanic

Registered User.
Local time
Today, 05:01
Joined
May 25, 2000
Messages
377
Here is the code to send it in rich text format:

DoCmd.SendObject acReport, "ReportName", "RichTextFormat(*.rtf)", _
"AnyEmail", , , "OptionalSubject", "OptionalText", False

Just replace the Report name with your reports name, AnyEmail with the email address, OptionalSubject and OptionalText with any text you might want to add to the message. If you don't want to fill the subject or text with anything just leave the space between the commas blank.

If you want to pull the email address, subject or text from a field on your form you can do it by substituting the "AnyEmail" with Me.YourTextBoxName (no quotes). And you can do the same thing for the other optional items.

Post back if you have more questions.
 

Talismanic

Registered User.
Local time
Today, 05:01
Joined
May 25, 2000
Messages
377
By the way I forgot to mention you can put that code behind a command button on any form.

If you would rather do it with a macro you can do it with the SendObject.
 

harix

Registered User.
Local time
Today, 05:01
Joined
Jul 21, 2000
Messages
14
Talismanic, Glen,

Please excuse my butting in?

Can I use this code to send one page of a multi-page report to the email address on the report. e.g. 100 different teachers get one page per teacher. Then use the textbox name Me.Report![CourseDateUsageAll]![Teacher_Email]

Thanks


[This message has been edited by harix (edited 01-09-2001).]
 

Talismanic

Registered User.
Local time
Today, 05:01
Joined
May 25, 2000
Messages
377
harix, I think it would be possible but I would need some time to work it out.

Also, maybe some one else who has done this will post a solution. Either way, I will get back to you shortly.
 

rhay

Registered User.
Local time
Today, 05:01
Joined
Mar 30, 2001
Messages
24
Is there a way to use this to a distribution list?

Robert
 

Users who are viewing this thread

Top Bottom