SendObject

P

PeterM

I have code in a form that opens a report and sends it to an email recipient.
I use:

DoCmd.SendObject _
acSendReport, _
Me.ReportCalled, _
me.ReportTypeDesc, _
Me.EmailAddress, _
, _
, _
Me.EmailSubject, _
Me.EmailMessage, _

This code generates an error saying the output type is invalid.
Me.ReportTypeDesc is set to acFormatRTF. I verified this in debug mode.
When I change the code to:

DoCmd.SendObject _
acSendReport, _
Me.ReportCalled, _
acFormatRTF, _
Me.EmailAddress, _
, _
, _
Me.EmailSubject, _
Me.EmailMessage, _

it works fine. Is it not possible to use a variable to contain the
outputtype of the report being emailed?

Thanks for your help!
 
R

RonaldoOneNil

I suspect you have set Me.ReportTypeDesc to the string "acFormatRTF" but in
fact
acFormatRTF is a constant itself that represents the string "Rich Text
Format (*.rtf)"
 
D

De Jager

PeterM said:
I have code in a form that opens a report and sends it to an email
recipient.
I use:

DoCmd.SendObject _
acSendReport, _
Me.ReportCalled, _
me.ReportTypeDesc, _
Me.EmailAddress, _
, _
, _
Me.EmailSubject, _
Me.EmailMessage, _

This code generates an error saying the output type is invalid.
Me.ReportTypeDesc is set to acFormatRTF. I verified this in debug mode.
When I change the code to:

DoCmd.SendObject _
acSendReport, _
Me.ReportCalled, _
acFormatRTF, _
Me.EmailAddress, _
, _
, _
Me.EmailSubject, _
Me.EmailMessage, _

it works fine. Is it not possible to use a variable to contain the
outputtype of the report being emailed?

Thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top