OpenReport vs. OutputTo

L

Larry

I've been watching with some interest the postings regarding sending an
Access report to PDF. What I need to do is similar, but instead of sending
the report to PDF, I siimply need to send it to a Word (RTF) document.
Theoretically, I could use an OutputTo Method, instead of the OpenReport
method -- except for the fact that OutputTo does not seem to accept filter
conditions. (That limitation is incredibly frustrating! And so unecessary!)
I specifically need to be able to specify filter conditions through public
VBA variables. I cannot hard code these filter conditions in a saved query
because I need for the user to be able to specify the variable through an
InputBox, but I also need to be able to run many reports from a single
command, all using the same filter variable from the input box, so a set of
parameter queries won't work.

As an example, I need for the user to press a single button and run:

rptAssessments WHERE strSession = "18" AND strRegion= "01" --> Word
document

Also by pressing a single button to run all the followng reports:

rptAssessments WHERE strSession = "18" AND strRegion= "01" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "02" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "03" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "04" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "05" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "06" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "07" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "08" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "09" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "10" --> Word
document
rptAssessments WHERE strSession = "18" AND strRegion= "11" --> Word
document

On a different occasion, they might need to run either of these reports for
entirely different sessions. If I can capture, store, and use in a filter
situation, the Session number, then I make it easy to give the user a series
of buttons for the different regions, as well as one button for all regions
that makes calls to the reports for the individual regions.

Any help on this that anyone can offer will be most appreciated.

Larry
 
D

david epsom dot com dot au

Use OpenReport to open the report in preview mode, with
your filter etc, then use OutputTo to send the Open,
Filtered report.

If it is critical that the report not be displayed, and
you are brave, you can turn off screen painting while
the report is calculated and exported.

RTF export has known problems, sometimes damaging memo
fields, but also sometimes truncating number fields, because
the algorithms by which it calculates what part of a
field is visible are faulty, and have never been corrected.


(david)
 

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

Top