Home  Fees/Services  Access 2010 Template  Access Tutorial  Access Download  Articles  Search  Contact  Privacy  Links

Report Sent Via Email Attachment
Sending Reports in Email to MS Outlook






Visual Basic Tutorials:
Access-Google Earth
Age Calculation
Change To Proper Case
Email via Gmail #1
Send Gmail Email #2
Inactivity Logout Code
Outlook Email
Read Email Access
Email Attachment
Send Outlook Email
Running Sum
Denormalize Records
Stock Quotes
CreateQueryDef
Find Database Path
Detail-Master Update
Data Field Validation
Field Value New-Old
FindFirst
Access Version
Global Variable Parameter
Global Variables
Active Labels
Files List Box
Mail Merge
Quick Sort
Recordset Filters
Reference Form Field
Select Case
Access Transactions


Visual Basic Function Examples



Email Report Attachment from VBA

Send Microsoft Access Report as Outlook or Other Email Attachment

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 follows:

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

End If

    Goto OK_Exit:

Error_MailIt:

    MsgBox Error$ & " MailIt " GoTo Exit_MailIt

    Resume OK_Exit

OK_Exit:

    Rst.Close

    Set Rst = Nothing

End Sub

More recent 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.

 










Blue Claw Database Design Downloadable Tutorial:
Choose Command Dynamic SQL Order By  








A Blue Claw Software Design Template:

Asbestos Survey Project Database
 










A Blue Claw Database Design Article:

How To Create Faster Access Databases
 

Microsoft Office:
MS Access 2000 Through 2016 and Office 365 & Sharepoint


Contact Information

Copyright 2000-2017 Blue Claw Database Design

Microsoft Access 2007, 2010, 2013 & 2016