Function Send_RC()
On Error GoTo Send_RC_Err
DoCmd.OpenReport "Record of Complaint", acViewPreview, "",
"[Complaints]![ComplaintNumber]=[Forms]![ComplaintForm]![ComplaintNumber]",
acNormal
DoCmd.OpenReport "AckLetter", acViewPreview, "",
"[Complaints]![ComplaintNumber]=[Forms]![ComplaintForm]![ComplaintNumber]",
acNormal
DoCmd.SendObject acReport, "Record of Complaint",
"SnapshotFormat(*.snp)", "", "", "", "Consumer Complaint", "", True, ""
Send_RC_Exit:
Exit Function
Send_RC_Err:
MsgBox Error$
Resume Send_RC_Exit
End Function
Thanks for any help.
1. perform to send objects, 1 per report
DoCmd.SendObject acReport, "Record of Complaint",
"SnapshotFormat(*.snp)", "", "", "", "Consumer Complaint", "", True
DoCmd.SendObject acReport, "AckLetter",
"SnapshotFormat(*.snp)", "", "", "", "Letter", "", True
Also, you do not need to open the report to send the e-mail.
2. automate Outlook to create a mail, with both attachement and fire it off.
You can find an example (need to be modified slightly for your needs) at
http://msdn2.microsoft.com/en-us/library/aa159619(office.11).aspx#odc_ac_olauto_sendanoutlookmessageusingaccess
If you need more help, post back indicating which method you've chosen to
adopt and how I can further assist you.
--
Hope this helps,
Daniel Pineault
If this post was helpful, please rate it by using the vote buttons.
Daniel Pineault
If this post was helpful, please rate it by using the vote buttons.