Feeding Names into a Query/Report

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi

I have a table which holds the names of Managers in an
organisation. Other tables then allow staff to be
allocated to a manager. I have a report which uses a
query which shows all the staff reporting to a particular
manager, with a page break between each manage and that
all works fine.

What I would like to know is whether there is an easy way
to feed the names of the managers (in the manager table)
into the query or report as a "batch" so that I don't have
to select a name from a drop down list. The reason I want
to do this is that the current report has EVERY manager,
and if I could produce one report per manager, I can
publish it using word and then email the attached report
to the relevant manager.

Any input most welcome and thanks in advance for any
reponses.

Peter
 
Peter,

If your managers are all in one table, you could open a
recordset based on that table, then loop thru each
record. Inside the loop, you would output the report or
use sendobjects to send the report, passing the report a
Where argument that matches the current manager.

I'd put this code in the click event of a button on your
form.

I've done this with individualized reports that I
generated for over 300 sites across the country. Ran the
code once a week and saved me a days worth of work each
week.

Only problem was that using sendobjects, the return
address on all the emailed reports was my user logon email
address rather than the one I would have preferred. I
never did figure out how to change the replyto email
address, but I think I could have gotten around this if I
had actually been willing to play with Outlook automation.
 
Back
Top