Report Total based on calculated control

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

Guest

in a report in the detail section i have the following text boxes:

tbPlan control source is in my field list: SumofPlan
tbPrior control source is in my field list: SumOfActualPrior
tbCurrent control source is in my field list: SumOfActualCurr
TBDiff control source is the following:
=IIf([tbPrior]=0,[tbPlan]-[tbCurrent],[tbCurrent]-[tbPrior])


In my report footer, I add the textbox named tbTotDiff and add the control
source to total all the amounts in the detail feilds for TBDiff:
=Sum([TBdiff])

it prompts me for a parameter? Anyu ideas?
 
You cannot sum a calculated control.

Repeat the entire expression in the Control Source of your text box:
=Sum(IIf([SumOfPlan]=0,[SumOfPlan]-[SumOfActualCurr],[SumOfActualCurr]-[SumOfActualPrior]))

Alternatively, add the calculated field to your query so you can sum it:
TBDiff:
IIf([SumofPlan]=0,[SumofPlan]-[SumOfActualCurr],[SumOfActualCurr]-[SumOfActualPrior])
Since your query seems to be a Totals query, you would need to select
Expression in the Group By row.
 
Back
Top