By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,639 Members | 2,340 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,639 IT Pros & Developers. It's quick & easy.

Print Individual Reports to Pdf using loop

P: 3
Hi, I'm desperate. I've been trawling through this and other forums but still can't work out what to do. I've seen similar questions but my lack of code knowledge has stopped me working this out myself.
I have a report to update clients on the status of work we are doing for them. I need to automatically create individual reports for each client showing updates from the previous month.
The report is called: rMRClient
The query it is based on is: qMRClient
I want a separate report printed to pdf for each different client, the field identifying the different clients is: Company
I want the records for the previous month (eg. this month is January 2007 but I want the report sent out now with results where the CommentDate was December 2006).
At the moment I have to open the report, using the query to individually select the Company and month. It is obviously too cumbersome to do this 100 times each month!
Looking forward to your help...
Jan 2 '07 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Hi, I'm desperate. I've been trawling through this and other forums but still can't work out what to do. I've seen similar questions but my lack of code knowledge has stopped me working this out myself.
I have a report to update clients on the status of work we are doing for them. I need to automatically create individual reports for each client showing updates from the previous month.
The report is called: rMRClient
The query it is based on is: qMRClient
I want a separate report printed to pdf for each different client, the field identifying the different clients is: Company
I want the records for the previous month (eg. this month is January 2007 but I want the report sent out now with results where the CommentDate was December 2006).
At the moment I have to open the report, using the query to individually select the Company and month. It is obviously too cumbersome to do this 100 times each month!
Looking forward to your help...
When printing your report you will need to set criteria. The report query should return all records then when printing

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "ReportName", acNormal, , "[Company]=" & 'Your criteria here' & " AND [Month]=" & 'Your criteria here'
Mary
Jan 2 '07 #2

P: 3
When printing your report you will need to set criteria. The report query should return all records then when printing

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "ReportName", acNormal, , "[Company]=" & 'Your criteria here' & " AND [Month]=" & 'Your criteria here'
Mary
Thanks Mary, but that still won't automatically loop through the Company records to product individual reports
Jan 2 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Thanks Mary, but that still won't automatically loop through the Company records to product individual reports
It will if you put it within a loop. For instance if you put the company list in a recordset and loop through each record printing one report each time.

Mary

For hints on how to use recordsets look at

Access VBA DAO recordset loop using two recordsetsThis example uses two recordsets but you will probably only need one.
Jan 2 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.