I would like to email a contract confirmation in PDF after it has been generated using a Form.
I have saved the form to a report.
Report Name = contract confirmation
Would like to just email/pdf the current report. Idendifier is "ContractID".
Would then like the [To] field to automatically look up the email address entered in the current form. field name for the email address = "Email".
Would like the subject to be "Contract Confirmation" and "Trading Name" and "Contract ID".
Tried this but looks like i have entered in to many arguements due to the first contractid= to print the current record only. Works ok when printing, but seems send object code has different structure. Appreciate any insight. Thanks.
Private Sub EmailContractConfirmation_Click()
DoCmd.SendObject acSendReport, "Contract_Confirmation", acFormatPDF, , "ContractID=" & Me!ContractID, ["Email=" & Me!Email], [Cc], [Bc], ["Contract Confirmation" & "Trading name=" & Me!Trading Name & "ContractID=" & Me!ContractID], [MessageText], [EditMessage], [TemplateFile]