Email report

Xenix

Registered User.
Local time
Today, 00:45
Joined
Oct 8, 2001
Messages
124
I have a problem with emailing a report, if I want to view a report quotation I use the code:
Private Sub Preview_Click()
On Error GoTo Err_Preview_Click


DoCmd.Save acForm, "Quotation"
DoCmd.OpenReport "QuotationEMail", acPreview, "", "
=[Forms]![Quotation]!
"


Exit_Preview_Click:
Exit Sub

Err_Preview_Click:
MsgBox Err.Description
Resume Exit_Preview_Click

End Sub

But if I want to email the report I use:

Private Sub Command42_Click()
On Error GoTo Email_Err
DoCmd.Save acForm, "Quotation"

DoCmd.SendObject acSendReport, "QuotationEMail", acFormatRTF, Me.Emailaddress, , , "Quotation", "Please find attached quotation:", True

Email_Err:
MsgBox "Email Not Sent", , "EMAIL ALERT"
End Sub

See my problem? I don't know where to put the "
=[Forms]![Quotation]!
" on the SendObject command?

anyone know how to do this?
many thanks
Mike
 
If all you are doing is showing the value from the Form in a control on the report, then you can link the report control directly on the ControlSource property of the control in the report.

ie TextBox called txtQuote would have a ControlSource of: =[Forms]![Formname]![FormControl]

hth
 
Thank you Harry but I do have this in there but it will not open the report still for any other customer other than the first one?

DoCmd.SendObject acSendReport, "QuotationEMail", acFormatRTF, Me.Emailaddress, , , "Quotation", "Please find attached quotation:", True

This works fine for the first record but not for any others. The report requests that the Quote number is required to display that Quote. but I don't know how to pass the value to the Report using the SendObject command within this line of text.

[This message has been edited by Xenix (edited 11-29-2001).]
 

Users who are viewing this thread

Back
Top Bottom