Equation in report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My report consists of three subreports:
1. Previous balance
2. current transaction
3. adjustment

I would like to sum up the amount showed in those subreports to calculate the latest balance for each customer.
However, some customer may have no record in those subreports (e.g new customer may have no previous balance).
How can I do it?

Error messages for some customers were showed because of no previous balance / current tranaction / adjustment.

Thank you so much for your help.
 
Daryl,

Use this type of syntax in your calculated controls...
=IIf(NameOfSubreport.Report.HasData,YourTotalAmount,0)
 
Dear Steve

Thanks for your equation. However, the same problem still exists
I can not sum up the amounts in those subreports

My equation is
(name of the text box)[previous balance] = IIf(IsError([my report name1].Report![my amount1]),0,[my report name1].Report![my amount1]

*** Similar equations are set for all both the [current transaction] and [adjustment] **

It showed the same result with yours when I set the equation separately for those amounts in subreport

But, when I sum them up like
total amount =[previous balance]+[current transaction]+[adjustment]
the result is error again

What's wrong with my equation? How can I solve it? Thank you so much for your answering

Dary

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Daryl

Use this type of syntax in your calculated controls..
=IIf(NameOfSubreport.Report.HasData,YourTotalAmount,0
 
Daryl,

I assume that in the footer section of each of the subreports, you have
a textbox which gives you the total for the data in each of the
subreports... is this right? Is this what you are referring to as
[previous balance], [current transaction], and [adjustment]?
Well, if I am reading the situation correctly, the control source of the
totals textbox on the main report needs to be something like...
=IIf(FirstSubreport.Report.HasData,[previous
balance],0)+IIf(SecondSubreport.Report.HasData,[current
transaction],0)+IIf(ThirdSubreport.Report.HasData,[adjustment],0)
 
Dear Steve,

Great!! Thank you very much for your help.

I have set a total text box for all the subreports and then set the equation that you mentioned. ( I have not set the total for [previous balance] before)

Daryl
 
Back
Top