O
Opal
Is it possible to code in VBA a parameter response in order to output
a report in
rich text format?
a report in
rich text format?
To send a report, use this command:
DoCmd.SendObject acSendReport, strReportname, acFormatRTF, strRecipient,
strCC, strBCC, strSubject, strMessage
The string variables can be populated however you want, either from the db,
from code, from the user, whatever.
The two constants, acSendReport, and acFormatRFT are the only things that
are literals.
- Show quoted text -
- Show quoted text -
To send a report, use this command:
DoCmd.SendObject acSendReport, strReportname, acFormatRTF, strRecipient,
strCC, strBCC, strSubject, strMessage
The string variables can be populated however you want, either from the
db,
from code, from the user, whatever.
The two constants, acSendReport, and acFormatRFT are the only things that
are literals.
- Show quoted text -
To send a report, use this command:DoCmd.SendObject acSendReport, strReportname, acFormatRTF, strRecipient,
strCC, strBCC, strSubject, strMessageThe string variables can be populated however you want, either from the
db,
from code, from the user, whatever.The two constants, acSendReport, and acFormatRFT are the only things that
are literals.
Actually, that doesn't really help me. I am trying to Output a report
in rich text format not
send an object. The report is based on a query with the criteria
pointing to a combo box
on a form, i.e. user selects to view report and selects an area from a
drop down box on a
form then a report is created for that specific area. The criteria on
the query behind the
report is Forms![frmSelectArea]![cboArea]. If I use the
DoCmd.OutputTo, I get a parameter
pop-up for the Forms![frmSelectArea]![cboArea], I want to know if I
can use a code in
VBA that will provide this criteria and eliminate the pop-up.
How will the report know what Area to use, if the form isn't open?
Do you want a report with all Areas? If so, you should change the source of
the report's data, so that it references a query that does not have a
parameter.
If you know what Area to use, then you can use VBA to write a query that
only shows that Area, and use that query as the basis of your report.
Also, what do you mean by 'Output', if you don't want to send it? Are you
just trying to view it in Print Preview?
I maintain my position. You have a parameter query that refers to a
control on a form. If that form is open, Docmd.Outputto will work as
expected. If it is not, a parameter box will open. You don't like
that, but that's what Access has to do.
Workarounds include what I suggested: write a different query. Another
option may be to replace that parameter with: GetParameter()
This would be a public function in a standard module, and it would
return the original expression if the form is open, or the value that
you're stating you know the value of somehow.
-Tom.
<clip>
- Show quoted text -