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

Print 3 reports with one button

P: 3
In Access 2000, I have three reports, named as follows:

All three reports pull information from the same table (e.g. tbl_Customers).
I have one form called Customers and I original had 3 buttons each printing a specific report. base on the customer shown on the form.

I want to create a single button that will print all 3 reports. Everything I tried, its printing every record. I just want to print the record shown on the Customer form

Can anyone help me?

Jan 2 '10 #1
Share this Question
Share on Google+
4 Replies

Expert 2.5K+
P: 3,072
Place three "docmd.openreport" commands in the code for the button and add the unique ID of the Customer to the filter parameter.

You could also create just one report with three sub reports to show all information.

Jan 2 '10 #2

Expert Mod 15k+
P: 31,485
As Nico says you need to specify the filter as a parameter in your calls. Is that straightforward for you? I somehow doubt you'd post a question just for that so maybe what you need is a little more complicated. If so, then please explain what you want more clearly. As it is, Nico's reply answers it directly.
Jan 2 '10 #3

Expert 5K+
P: 8,633
Here is a little routine that I created when I want to output Multiple Reports based on the same Criteria and similar Data Sources. The trick is to prefix the Reports you wish to Print with a unique series of characters that is defined by the Constant conRPR_PREFIX . In my case I use rptP as a Unique Identifier. To actually Print the Reports, change the acViewPreview Argument to acViewNormal. [EmployeeID] is a Number, modify for String Values. Any questions, feel free to ask.
Expand|Select|Wrap|Line Numbers
  1. Dim intNumOfReports As Integer
  2. Dim intRptCounter As Integer
  3. Dim strReportName As String
  4. Const conRPR_PREFIX As String = "rptP"
  6. intNumOfReports = CurrentDb.Containers("Reports").Documents.Count
  8. For intRptCounter = 0 To intNumOfReports - 1
  9.   strReportName = CurrentDb.Containers("Reports").Documents(intRptCounter).Name
  10.     If Left$(strReportName, 4) = conRPR_PREFIX Then
  11.       DoCmd.OpenReport strReportName, acViewPreview, , "[EmployeeID] = " & Me![EmployeeID]
  12.     End If
  13. Next
Jan 3 '10 #4

P: 3
not exact but I fixed it..thank you
Jan 6 '10 #5

Post your reply

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