Formula That Works in Footer Bombs in Detail

  • Thread starter Thread starter BarryC
  • Start date Start date
B

BarryC

I have a formula that works fine in the report footer (with the
addition of the Sum Fx where appropriate) but bombs by showing #Error
when it is in the detail of the report.

The formula is: =IIf([Minutes]\60>=1,[Minutes]\60 & " Hr " & [Minutes]
Mod 60 & " Min",[Minutes] Mod 60 & " Min")

[Minutes] is an integer.

When it is placed in the report footer as:
=IIf(Sum([Minutes])\60>=1,Sum([Minutes])\60 & " Hr " & Sum([Minutes])
Mod 60 & " Min",Sum([Minutes]) Mod 60 & " Min")

it works fine.
 
Any chance that the value of [Minutes] could be Null in any of the report's
records? Null will cause an error when you try to use it in the first
expression's calculations, whereas Sum function ignores Null values.
 
Most of the records do have a number in them, there was at least one
that I know was null. All of the lines show #Error however.

I put a NZ function in the formula to trap for Null; still every line
is #Error.
 
Ken,
It was that old "Textbox named the same as the Datafield" bug again.
After I renamed the textbox (and fixed the formula where it
automatically substituted the box name for the datafield - WTF?) it
worked OK.

Thanks!
 
Reports are more prone to that renaming issue in expressions when you change
the name of a textbox from the name of its bound field.
Glad it's working now.
 
Back
Top