using AVG in footer of report

  • Thread starter Thread starter Spidey3721
  • Start date Start date
S

Spidey3721

Although I may be leaving some vital info out, Let's start with this.


I ahve a report that is grouped by [Field1], then by [Field2]

I have a [CalcFieldTxt] in the detail section of the report that makes a
calculation using another field in the detail section, and dividing it by a
DSUM expression. This field calculates correctly.

If I try to place a textbox in EITHER the [Field1] or the [Field2] footer
with the following controlsource: =AVG([CalcFieldTxt]) and then preview the
report I get prompted for a [CalcFieldTxt] parameter, as if it does not
recognize the textbox...

Am I doing something obviously wrong, or do I need to offer more info...

Thanks...
 
I figured out a way to do it...

I am assuming that since I was trying to average a calculated textbox from
the report detail, I was getting an error because Access is not storing that
calculated field as part of the dynaset for the report ...(?)

Anyways - I placed the calculation into the Query that the Report was based
on, making a new calculated Field; used that field instead of the original
textbox - and it all worked!

Thanks anyways...
 
I've seen this many a time, Access just doesn't like expressions with
calculated fields in headers/footers... I suppose there's a good reason for
this from a technical point of view, but don't ask me what it is.
The way I've found around it is to repeat the whole calculated field
epression in the header/footer, instead of referencing the calculated field;
for instance, suppose my calculated field (TotalValue) in the detail is
=[NetVal] + [Tax], then in the footer I would put
=SUM(([NetVal] + [Tax]))
instead of =SUM([TotalValue]) which does not work.

HTH,
Nikos
 
Back
Top