473,770 Members | 1,996 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 2014
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
2130
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
7466
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
3339
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
3590
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
1729
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
2932
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
1522
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
2045
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
5456
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
9618
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...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7456
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
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.