"John Taylor" <ja**@iinet.net.au> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
I have finally got "SendObject" to work but now have a filter problem.
I have a database set up that I generate orders and print them as a single
page report. I've set up a filter so that when I "onclick" the button it
simply prints the order I can see (ie if I've entered Order 0100 - it only
prints the one that is open in the form).
I want the command button to continue printing but to also send the single
page by e-mail. However, although the print is still only printing the one
report the e-mail is attaching all of them - I have about 250 orders and
they all get attached to an e-mail.
Another "would be nice" is to have the actual report format attached to the
e-mail instead of RTF (snapshot would be nice but I don't think it works with
SendObject)
Can any guru's look at the attached code and tell me what I am doing wrong.
The problem is that SendObject doesn't have an optional WHERE argument like
OpenReport does (your strFilter variable). There are several ways to get the
same effect.
If you open the report in print preview and leave it on the screen when you
issue the SendObject command it will inherit the filtered data being displayed
in the report on-screen.
You can have the Open event of the Report test a value, either a public variable
or a control on your form and use that to apply a filter to itself. This is the
method I generally use.
If you always want to print/send the report from this form and will always be
doing so for one record at a time you can modify the query that the Report uses
so that it picks up selection criteria from the form.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com