I'm not sure about email options other than Outlook, and so you should probably thoroughly look into Jim's CDO suggestions.
You can also look into the DoCmd.SendObject method...the VBA help page on SendObject is very thorough and it is a few minutes of reading that is well worth your time. This is a good option if you have not previously exported the report to a file somewhere outside of Access.
For a third possibility, if you want more fine-grained control over the process, the following will work with Outlook. Make sure you set a reference to the Microsoft Office Outlook library in the VBA window by going Tools > References... and then scrolling down to Microsoft Office Outlook and check marking it.
- Dim olApp As New Outlook.Application, olMail As Outlook.MailItem
-
Set olMail = olApp.CreateItem(olMailItem)
-
-
With olMail
-
.To = strSendTo
-
.Subject = strSubject
-
.ReadReceiptRequested = False
-
.Body = strBody
-
.Attachments.Add strAttachFile
-
-
.Send
-
End With
-
-
Set olApp = Nothing
-
Set olMail = Nothing
In this code, the various strings are pieces of information that I set elsewhere in the code, such as the recipient email address, the subject, etc.
Also, strAttachFile is the path to whatever you want to attach to the email. This implies that you need to have previously saved the report as an external file first, which may or may not be your situation.
Pat