Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Report by e-mail

Status
Not open for further replies.

Dina01

Programmer
Mar 26, 2002
204
CA
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
 
Hi

Change your query on which yor report is based to have a criteria of Forms!MyForm!CallId

where MyForm is the name of your form

Then you can dispense with the criteria in the docmd.OpenReport

make sure you save the record, before printing Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top