emailing reports

D

Don Ireland

Another question... I have seen how to email a report from a database
(sendobject). I have even managed to make that work. I have also created
reports with "where" conditions (like entering info into a service ticket
form and generating the printable ticket. you want 1 ticket so you generate
the report with the where condition service ticket number = number for the
current record.)

Now, how would I go about emailing the report with the where condition?
That doesn't seem to be an option in the sendobject command. Do I need to
create a seperate Report based on a different query or is there something
else needed?

Thanks again for the help

Don
 
R

Rick Brandt

Don said:
Another question... I have seen how to email a report from a database
(sendobject). I have even managed to make that work. I have also
created reports with "where" conditions (like entering info into a
service ticket form and generating the printable ticket. you want 1
ticket so you generate the report with the where condition service
ticket number = number for the current record.)

Now, how would I go about emailing the report with the where
condition? That doesn't seem to be an option in the sendobject
command. Do I need to create a seperate Report based on a different
query or is there something else needed?

Thanks again for the help

Don

A somewhat "hackish" way of doing it is to use OpenReport to bring the
report up in preview (using a where clause) and then follow that code line
immediately with the SendObject comand. This works because if you run a
report that is already opened in preview then the second instance will
always inherit the filter that is applied to the preview instance. Once the
SendObject line has run you could automatically close the preview.

OR
You can put your where clause into a public variable and have the Open event
of the report grab it and apply it.

OR
You can store the filter in a TextBox on the form from where you are
invoking SendObject and the report can grab it from there in its Open event
(some people don't like to use public variables).

OR
You can pass the filter in the OpenArgs argument of OpenReport (Access 2003
only)

OR
You can have the query for your report reference a TextBox on the form for
its criteria. That would make the Where clause unnecessary even for normal
printing and previewing, but would make the report less flexible.
 

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