Here's the code that would go behind a button named cmdMailReport on the form. This assumes that the report is an existing report.
Code:
Private Sub cmdMailReport_Click()
On Error GoTo Err_cmdMailReport_Click
Dim stDocName As String
Dim stToEmail As String
Dim stSubject As String
Dim stBody As String
stDocName = "MyReportName"
stToEmail = "recipient1@sample.com;recipient2@sample.com"
stSubject = "MyReportName For " & Format(Date(), "mm/dd/yyyy")
stBody = "MyReportName Is Attached for your Review as/of " & Format(Date(), "mm/dd/yyyy")
DoCmd.SendObject acReport, stDocName, acFormatPDF, stToEmail, , ,stSubject, StBody
Exit_cmdMailReport_Click:
Exit Sub
Err_cmdMailReport_Click:
MsgBox Err.Description
Resume Exit_cmdMailReport_Click
End Sub
I've put in a default subject line, body test and recipients, but you don't have to code those, you could let the user put them in themselves.
Check this page for all the options on the SendObject command http://msdn.microsoft.com/en-us/libr.../ff197046.aspx
Here's the general format:
.SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile)
OutputFormat for a report can be either PDF format (acFormatPDF)or RTF format (acFormatRTF)