Link to home
Start Free TrialLog in
Avatar of frank_guess
frank_guessFlag for United States of America

asked on

Using a table to run a query from and writing each item into a report.

I have a table with Department Numbers and names and need to create reports for each of the department numbers from the table.  The reports are created from a personnel table and it would be by department number.  I am working to automate the report creation versus someone having to select 200 separate department numbers.

Table one - TBL_Dept_List  -  DeptNo, DeptName, TotalTeam
Report has data in it along with the team member information with the DeptNo as the link.

Could use a little help  Thank you.
Avatar of Richard Daneke
Richard Daneke
Flag of United States of America image

You can create a table of department numbers and do VBA module to read the table and create a report for each table value.
You can create a table of all departments and use an additional field to select departments on which to report and do VBA module to read the table and create a report for each table value.
Both of the above would generate a different report for each department or
You can create a table as above and use it in a query to create your reports in one file.
Avatar of frank_guess

ASKER

Thank you
The problem is I have the table already finished but I am looking for the module or code behind the button to make this happen.  

Did you try to create a Report based on a Group/ Section of your DepartmentName / No?
Then follow the steps as suggested in my link.

HTH,
Daniel
If I am reading you request correctly there is no need to create multiple reports from data in the same table.

Simply create one report with all the data, then simply filter it for the data (department, team member, ...etc) you wish to display.

I believe this is basically what danishani is suggesting, so I'll step aside and let him outline the principles...

;-)

JeffCoachman
Sorry I guess I was not clear.  I have a table with the business cost centers, I need to run a report for each cost center number and save the report as a file with that name example:

Cost_Center_680_5040_05_12_2011_PersonnelRpt.rtf
Cost_Center_680_5022_05_12_2011_PersonnelRpt.rtf
Cost_Center_680_5075_05_12_2011_PersonnelRpt.rtf

These reports go on through over 200 or more business centers.  The table is a list of those cost centers and the reports are created by matching the cost center number against the Cost center number that is listed in the data file that is used to create the report.  Even through the report can be page separated by start the report by the cost center number this does not allow you to create individual reports.  Why am I needing this is to create a folder or directory of individual cost center reports without having to manually run each one and save it myself.  Takes all day that way versus using the table and creating each report without human touch.
Ok, below link give you an idea on how to do this:

http://bytes.com/topic/access/answers/799273-access-2007-create-report-per-group

Just copy the idea and replace the code to your convenience.

HTH,
Daniel
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will review and get back to you.  Thanks
That is exactly what I am looking for.  Thanks