473,419 Members | 3,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Print 3 reports with one button

3
In Access 2000, I have three reports, named as follows:
rptCrew
rptService
rptWork

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?

Thanks!
Jan 2 '10 #1
4 2624
nico5038
3,080 Expert 2GB
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.

Nico
Jan 2 '10 #2
NeoPa
32,556 Expert Mod 16PB
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
ADezii
8,834 Expert 8TB
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"
  5.  
  6. intNumOfReports = CurrentDb.Containers("Reports").Documents.Count
  7.  
  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
mode67
3
not exact but I fixed it..thank you
Jan 6 '10 #5

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

Similar topics

0
by: Ian | last post by:
(Sorry if I have repeated this, it did not appear the first time) I have the following code on a button. The idea is that when this button is clicked it prints several reports automatically then...
2
by: Claudia Fong | last post by:
Hi, I have 4 reports created in Ms-access and I will use VB to print those reports. My problem is I'm not sure if I can control wich report to print.. Those reports are almost the same, what...
5
by: Tony Dong | last post by:
Hi there, I am newer for dot net I want to make a report and then print it, the report may include images and text, how can I do that, any one can give me a suggestion? I know how to...
2
by: Rod | last post by:
We've got an old VB6 application which has 9 Crystal Reports it can print. These 9 reports are considered by our users to be in essence one "report", in the sense that they are all related and they...
1
by: Cam | last post by:
Hello, I am using vb.net 2005 with the report viewer control and the built-in reports (NOT CRYSTAL REPORTS). I have two datasets, two binding controls and two data table adapters. One complete...
2
by: Kil | last post by:
I designed a form that allows the user to enter dates, and click a checkbox so that certain forms may be loaded. However, I have had trouble getting the right information to load. I would like to...
0
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the...
5
by: Neetu | last post by:
Hi Everybody, Our reports works well on every machine but not on 64bit systems. We can view the report but when we press print button it does nothing, it just stay there and prompt nothing, even...
0
by: EricJudge06 | last post by:
We are converting some reports from Crystal Reports to Microsoft SQL Reporting Services (SSRS) in an ASP 2.0 VB.Net web app. Crystal had a function called PrintToPrinter which was being used to...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.