Here is a simple method for mailing an Access report to someone
as an attachment. This VBA example uses the docmd.sendobject to
email the report in rich text format (RTF).
Are you just starting out on your quest for a small business database? Need some advice or someone to bounce ideas off of? We are happy to chat with you to discuss options to your situation.
We create databases large and small. Some of our databases help run entire small businesses. We also handle unique businesses such as flyrod manufacturing, cheese making, marina management, and cable tv inventory.
This method should work with any email program running on your PC and should
also work for sending a PDF email attachment. The VBA programming code
Public Sub MailIt()
On Error GoTo Error_MailIt
Dim Rst As Recordset
open the table that the report reads to make sure there is a record in it.
Set Rst = CurrentDb.OpenRecordset("EmailRpt", & _ DB_OPEN_DYNASET)
If Not Rst.BOF Then
DoCmd.SendObject acReport, "RptEmailAdjustment", & _
"rich text format (*.rtf)", strEmailAddressGlobal, , , & _
StrSubjectGlobal , StrMessageGlobal
MsgBox Error$ & " MailIt "
Set Rst = Nothing
versions of Access give you the ability to output reports in PDF format
directly. This makes it much easier to send reports since almost everyone
is used to opening PDF attachments in their emails.