Need Help - Main & Two Sub Reports Calculations

Hazel

Registered User.
Local time
Today, 02:08
Joined
Apr 1, 2005
Messages
19
I have a main report and two sub reports

the two sub reports have a report footers with =Nz(Sum([TOTAL PRICE]),0)

my main form has two fields (SUB TOTAL & NARR SUB TOTAL) that refer to sub reports

=Nz([PRICES & QTY's (Q) subreport].[Report]![SUB TOTAL],0)
=Nz([NARR - PRICES & QTY's (Q) subreport].Report![NARR SUB TOTAL],0)

I have another field (GRAND TOTAL) on my main report that adds the above fields to give a grand total

=[SUB TOTAL]+[NARR SUB TOTAL]

This works but the problem is that maybe one of the sub reports has no data what so ever giving me #Error in SUB TOTAL or in NARR SUB TOTAL AND also in GRAND TOTAL i need the GRAND TOTAL to give me a result

Can anyone help
 
No data

Use the HasData function in your subreports. This way if data doesn't exist it will be given a value of zero and not give you the #error.
=IIF([Sub].Report.HasData=True, [Sub].Report!Amt, 0)


Hope this helps
 
What exactly to you mean


The field that is in my sub reports are in report footer and give me a grand total of another field

or do you mean the two fields that are in my main report

Please attached file

Go to Reports Paint Measurements - Full Report (Q)
 

Attachments

Last edited:
reports

In your Paint Measurements report...

In the Sub Total Data Source(bottom left of the report) place the following code:
=IIf([PRICES & QTY's (Q) subreport].Report.HasData=True,[PRICES & QTY's (Q) subreport].Report![SUB TOTAL],0)

In the NArr Sub Total field place this:

=IIf([NARR - PRICES & QTY's (Q) subreport].Report.HasData=True,[NARR - PRICES & QTY's (Q) subreport].Report![NARR SUB TOTAL],0)


If the data does not exist it will return zero.

Hope this helps.
 

Users who are viewing this thread

Back
Top Bottom