E-mail current record

BillyMac

Registered User.
Local time
Today, 13:36
Joined
Feb 27, 2004
Messages
24
Hi Guys
I have the following code on a button on a form that I want to e-mail a report with. The code below works fine when i want to e-mail all records but I only want the report to e-mail the current record.

DoCmd.SendObject acReport, "Report", "RichTextFormat(*.rtf)", Forms!MyForm!Emailaddress, "", "", "test", "The attached document contains your details", True, ""

I have searched and tried piecing together differing bits of code to get it to work but to no avail. I tried adding "Me.PersID" and got an error. Can anyone help please
 
Why not create a query that has all the same data as the form and add criteria based on the current record in the form (query by form)? The use that query as the recordsource for a report and then email that report. Probably not the most elegant solution but it should work.
 

Users who are viewing this thread

Back
Top Bottom