Send report by e-mail

Dina01

Registered User.
Local time
Today, 16:19
Joined
Apr 24, 2002
Messages
87
Hello,

I created a form that has send button that I need to send the current record to the report and then it send it to a specific user by e-mail.

I created this code in my Send Button
***********************************
Dim strDocName As String
Dim strWhere As String
strDocName = "rptInfo"
strWhere = "[CallNo]=" & Me!CallNo

DoCmd.OpenReport strDocName, acPreview, , strWhere
*************************************
This example works fine, but I need to send it by e-mail therefore I tried

DoCmd.SendObject acSendReport, "rptInfo", "SnapshotFormat(*.snp)", "gerarda.federici@casino.qc.ca", , , "Demande de clé", , True

but I am not too sure where to enter the criteria....

Can anyone help me
 
I'm fairly sure that you cannot do this but you can filter the recordset prior to opening it by basing the report on a query. Alternatively, you will need to create 2 reports, one that is filtered and one that is not (Unless you want to start to get into public variables to set the report's recordsource dynamically when it opens)
If you only ever use the report with one record, the query by form option would be my preferred choice.
 
Bonjour!
Have you kept the part within the ****
If not, put it back. (just before the new one)
That way, it puts the criteria in the report and then you send the report with the criteria included.
À la prochaine!
Newman
 

Users who are viewing this thread

Back
Top Bottom