Emailing Report with Filter

B

briantyndall

Hi,

I am having problems using the sendobject macro to send a report using
arguments such as ID=.

This is the parameters i am using for opening the report for printing:

Case Details, Report, , ="[ID]=" & [ID], Normal

But i cant get it to work with sendobject.

Can anyone provide any assistance, as to making this work with the
sendobject procedure please?
 
D

Dale Fye

Brian,

Generally, when I want to do this, it is only in conjunction with a loop
where I loop through a series or recipients that I want to receive their own
copy of the report with only their data. SendObject does not give you the
option of filtering a report the way that the OpenReport method does. To
accomplish this you will need to modify the query that is the basis for your
report. I generally do it by:

1. Adding a textbox on a form
2. Modify the query that the report is based upon so that it looks
something like:

SELECT * FROM yourTable
WHERE [SomeField] = Forms!yourForm.txt_ID

3. Populate the control (Step#1) with the value you want to filter on, this
is inside the loop, just before the SendObject method.

HTH
Dale
 

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