I know this has been posted several times, and I have tried to utilize the code and just replace with my pertanent info, but I have been unsuccessful. Using the button wizard on a form and have created a button which will run and create an email to send the report. The qry which runs the report also contains the email address I want the report to go to. I have pasted the email button code in hopes that someone can help me fill in the blanks.
Private Sub EmailReferrerReportbutton_Click()
On Error GoTo Err_EmailReferrerReportbutton_Click
Dim stDocName As String
stDocName = "rptReferrerInformation"
DoCmd.SendObject acReport, stDocName
Exit_EmailReferrerReportbutton_Click:
Exit Sub
Err_EmailReferrerReportbutton_Click:
MsgBox Err.Description
Resume Exit_EmailReferrerReportbutton_Click
End Sub
Where should I put in the "qryReferrerInformation.Referrer_Email" part to say that's the email address I want to fill in the "To" of the email Thanks for the help. Jim
Private Sub EmailReferrerReportbutton_Click()
On Error GoTo Err_EmailReferrerReportbutton_Click
Dim stDocName As String
stDocName = "rptReferrerInformation"
DoCmd.SendObject acReport, stDocName
Exit_EmailReferrerReportbutton_Click:
Exit Sub
Err_EmailReferrerReportbutton_Click:
MsgBox Err.Description
Resume Exit_EmailReferrerReportbutton_Click
End Sub
Where should I put in the "qryReferrerInformation.Referrer_Email" part to say that's the email address I want to fill in the "To" of the email Thanks for the help. Jim