Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Results of One Query To Run Multiple Instances Of Report 1

Status
Not open for further replies.

BTilson

Programmer
Jul 14, 2004
139
US
I know this must be possible, but I am drawing a blank on how to go about it.

I have an employees table that, along with other data, contains what shift and team they are on. The shift is just a 1, 2 or 3, while the team code is something like "QT", "DT", etc.

I also have a report that is a daily "Production Efficiency Report" of sorts. It has been requested of me to have the ability to batch print the production reports for each shift/team combination. I could go in and just hard code each one, but that just seems like terrible programming to me.

So instead, what I think would be good would be a query that returns employees for a specified shift/team combination (the easy part) and then using the record set returned from that query, run the production report for each returned employee ID. (The part I can't figure out how to do)

So for example, my query returns:

Employee 214 - 1st, QT
Employee 217 - 1st, QT
Employee 309 - 1st, QT

I then would want to automatically run the report 3 times, once each for 214, 217 and 309.

I'm sure this is doable, and I really feel like I am missing something obvious here.

Can anyone help me out?

Brooks Tilson
Database Development
Tilson Machine, Inc.
 
You need VBA.
Have a look at the 4th parameter of the DoCmd.OpenReport method.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I tried that, and it doesn't do what I am after (unless I am just misunderstanding how it works)

Each of these reports will only have one employees data on it, since they are passed out at the beginning of each shift to show our employees how they did efficiency wise for the previous day. So instead of filtering the report to just include the required employees, I instead need to run the report a seperate time for each returned employee.

Make sense? Please let me know if you need any more information. Thanks!

Brooks Tilson
Database Development
Tilson Machine, Inc.
 
Haha... *smacks self in forehead*

It's always the simplest approaches I seem to overlook. I'll test it, but I believe that would work perfectly well.

Thanks!

Brooks Tilson
Database Development
Tilson Machine, Inc.
 
Just wanted to say a quick thanks, the page break approach seems to work perfectly well, and greatly speeds up things, since it only has to run the query once per group, instead of per employee!

Brooks Tilson
Database Development
Tilson Machine, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top