Emailing a Single Report

Crash1hd

Registered CyberGeek
Local time
Today, 16:06
Joined
Jan 11, 2004
Messages
143
Ok I have created a report that I can now print no problem from the form that is connected to it, I want to do the same for the email now in the print all I had to do was add this

stLinkCriteria = "[Employees_Inbound_Query.Inbound_ID] =" & Me![Inbound_ID]

where the criteria was needed in here

DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

now for some reason microsoft didnt make it that simple for the email, I have searched this forum to no avail I have a table that holds the content a form that imputs and displays the content of the table and a report that I print or email of the form from the table now when access created the email button it gave me

Private Sub Email_Inbound_Report_Click()
On Error GoTo Err_Email_Inbound_Report_Click

Dim stDocName As String

stDocName = "Inbound_Report"
DoCmd.SendObject acReport, stDocName

Exit_Email_Inbound_Report_Click:
Exit Sub

Err_Email_Inbound_Report_Click:
MsgBox Err.Description
Resume Exit_Email_Inbound_Report_Click

End Sub

So I figured that it would be the same and only had to add the criteria however from the help file I have learned that DoCmd.SendObject doesnt have a criteria slot??? what is the easiest way of doing this! help :)
 
Easiest way I can think of is installing your criteria within the recourdsource of the report itself and not rely on the command button to filter your report. :p
 
Ok I think I understand what you are saying however if the report is being called from a query it would make more sense to put the criteria in the query correct?
 

Users who are viewing this thread

Back
Top Bottom