Supress sending rtf to printer

H

Harry V

How do I write a report to to rtf without printing it?

I'm currently using -

DoCmd.OpenReport "MyReport", acViewPreview, "qMyQuery", strFilter,
acHidden
DoCmd.OutputTo acOutputReport, "MyReport", acFormatRTF, strFileName,
False
DoCmd.Close acReport, "MyReport", acSaveNo

- which writes to an rtf but also prints to the defaulat printer. I would
like to give the user the option to write without printing.
 
S

SA

Harry:

I am suspecting that you are opening the report in preview to apply the
filter before outputting it. This could be your problem. There's
another method to use when trying to apply filters to a report prior to
issuing commands like docmd.outputto or docmd.sendobject, which is described
in this MS knowledgebase article.

http://support.microsoft.com/kb/299016/en-us

Give that a shot
 
H

Harry V

SA,

Actually, I used the preview for the filter initially, then sought a manner
to supress the preview in order to print immedialtely. Then someone came up
with the idea of saving the output as an rtf for a variety of purposes, then
some looping for more reports and then "let's suppress the printing to save
the paper." I imagined I could set the flag with a button and run the output
to the printer as well as the rtf, according to the flag. I just thought
there was something I could pass to the report to supress the printing, while
generating the rtf...

Sometimes too much flexibility is just as bad as too many restricitons...

Thanks

HV
 
D

david epsom dot com dot au

That does not print the report when I try it.

I just get preview, rtf, and close

We have used code like that for years, without problems.

(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