473,888 Members | 1,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Totalling subreports in main report?

I have a report concerning a customer.
In this report we find four subreports. They are in layout identical
but data comes from different tabel.
Now on the main report I count the totals of each report and sum them;

=[rptGBBGroepsIDJ aaroverzicht1].[Report]![Tekst100]+[Sub141].[Report]![Tekst100]+[Sub142].[Report]![Tekst100]

But if of of the subreports has no data for example because it has no
data I get an error...

How can I tell the totalling field that, if for example subreport 141
not exists, it should ignore the missing report?

A function like the X=nz([a])+nz([b])+nz([c])+nz([d]) but then for
reports........ ..

Anyone having a bright idea?

TIA, Henro

Jun 27 '06 #1
2 2019
Test the HasData property of the report in each subreport:

=IIf([rptGBBGroepsIDJ aaroverzicht1].[Report].HasData,
Nz([rptGBBGroepsIDJ aaroverzicht1].[Report]![Tekst100], 0), 0)
+ IIf([Sub141].[Report]![Tekst100].HasData,
Nz([Sub141].[Report]![Tekst100],0), 0)
+ ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Henrootje" <He****@gmail.c om> wrote in message
news:11******** *************@y 41g2000cwy.goog legroups.com...
I have a report concerning a customer.
In this report we find four subreports. They are in layout identical
but data comes from different tabel.
Now on the main report I count the totals of each report and sum them;

=[rptGBBGroepsIDJ aaroverzicht1].[Report]![Tekst100]+[Sub141].[Report]![Tekst100]+[Sub142].[Report]![Tekst100]

But if of of the subreports has no data for example because it has no
data I get an error...

How can I tell the totalling field that, if for example subreport 141
not exists, it should ignore the missing report?

A function like the X=nz([a])+nz([b])+nz([c])+nz([d]) but then for
reports........ ..

Jun 27 '06 #2
Thanks Alan!
Allen Browne schreef:
Test the HasData property of the report in each subreport:

=IIf([rptGBBGroepsIDJ aaroverzicht1].[Report].HasData,
Nz([rptGBBGroepsIDJ aaroverzicht1].[Report]![Tekst100], 0), 0)
+ IIf([Sub141].[Report]![Tekst100].HasData,
Nz([Sub141].[Report]![Tekst100],0), 0)
+ ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Henrootje" <He****@gmail.c om> wrote in message
news:11******** *************@y 41g2000cwy.goog legroups.com...
I have a report concerning a customer.
In this report we find four subreports. They are in layout identical
but data comes from different tabel.
Now on the main report I count the totals of each report and sum them;

=[rptGBBGroepsIDJ aaroverzicht1].[Report]![Tekst100]+[Sub141].[Report]![Tekst100]+[Sub142].[Report]![Tekst100]

But if of of the subreports has no data for example because it has no
data I get an error...

How can I tell the totalling field that, if for example subreport 141
not exists, it should ignore the missing report?

A function like the X=nz([a])+nz([b])+nz([c])+nz([d]) but then for
reports........ ..


Jun 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2135
by: Don Sealer | last post by:
I have a report that includes 5 different subreports. I'd like to be able to open this report using a date function (Start Date and End Date). I'd like all five subreports to show the data from those dates. I have learned how to use this start/end function but I can't figure out how to use it with these subreports. Right now the report opens but asks for start/end dates for each of the five reports. Is there a way I can input one set of...
3
7471
by: manning_news | last post by:
Using A2K. I've been asked to modify a report currently requiring only one date parameter to now accept a date range. The main report has 2 subreports and is not bound to a table or query. The report prints dental and hygenist appointments for the date (one subreport for each). The user wants to enter a date range and have one page for each date in the date range. I'm wondering how to modify the report. The only way I see is to create...
2
3345
by: AccessAl | last post by:
:confused: I have inheritted a system with reports that were probably written by a novice access programmer. My problem is a report with a dozen subreports in them. I had to add another subreport to that report. Many subreports set a global variable that is used to sum grand totals later. When I added my report, placed in the middle of the report, I found that the grand total subreport, which is placed after my subreport, is opened prior to...
1
3599
by: David | last post by:
Folks, I have four subreports in a report in the detail section. I suppose I could move them to the footer of the report. Anyway, if any of them have data, I want the main report to force a page break. I am trying to use the "hasdata" property for the subreports, but I am getting the generic error indicating property not available for object. How does one tell the main report (using VBA) not to throw in a page break unless the...
3
1734
by: DeanL | last post by:
Hi all, I'm currently pulling out my already thin hair and need a little help if possible. I have an Access 97 db that is used to store inspection information for different regions. My report is meant to show the number of inspections done in each region and what ratings they achieved as below: Region Green Yellow Red NR Total
6
2940
by: xian2 | last post by:
Hi All, I know you have heard this all before from the millions of other people asking the same question, but I have read through many other posts and NeoPa's guide and another guide i found on the internet (http://allenbrowne.com/casu-18.html) but to no avail. Some background info: frmTours Contains 2 subforms (on seperate tabs), one to select the desire Tour Days and the other to select the Additional Costs. rptInvoice
0
1525
by: billygotee | last post by:
Hi, I'm having an issue with VS .NET 2k5. I have a master report that is the parent of several subreports (the report got too big to keep it all in the same report). For a while this worked fine, the BuildAction property of each was set to Embedded Resource, and the subreport name was all I needed to change in the master report for each to be displayed (I handled the SubreportProcessing event to deal with data sources).
1
2049
by: MartinaN | last post by:
Hello, I have a MS Access 2000 question. I created a main report that consists of different subreports in the Detail section. I have a couple of queries that create tables for certain cities (the user enters the City ID). Everything works fine until the user enters an ID for a city that we don't have information for in all tables and then wants to see the report. When printing the separate subreports - the report still shows up just with an...
6
5463
by: Brett Barry: Go Get Geek! | last post by:
Hello, I have a main report with a Record Source, a DateToday table, that has the current Month and Year. I have about 60 queries, each pulling different data via ODBC, that I am creating subreports that go on the main report. The problem is that when I run the report the data shows on the screen but not the print preview. I am aware that the main report is not linked to the subreports because of the Link Master, Child Fields issue....
0
9961
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10886
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10439
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9597
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7990
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7148
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6014
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4245
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.