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

Totalling subreports in main report?

P: n/a
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;

=[rptGBBGroepsIDJaaroverzicht1].[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
Share this Question
Share on Google+
2 Replies


P: n/a
Test the HasData property of the report in each subreport:

=IIf([rptGBBGroepsIDJaaroverzicht1].[Report].HasData,
Nz([rptGBBGroepsIDJaaroverzicht1].[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.com> wrote in message
news:11*********************@y41g2000cwy.googlegro ups.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;

=[rptGBBGroepsIDJaaroverzicht1].[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

P: n/a
Thanks Alan!
Allen Browne schreef:
Test the HasData property of the report in each subreport:

=IIf([rptGBBGroepsIDJaaroverzicht1].[Report].HasData,
Nz([rptGBBGroepsIDJaaroverzicht1].[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.com> wrote in message
news:11*********************@y41g2000cwy.googlegro ups.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;

=[rptGBBGroepsIDJaaroverzicht1].[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 discussion thread is closed

Replies have been disabled for this discussion.