Formula That Works in Footer Bombs in Detail

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.
 
K

Ken Snell \(MVP\)

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.
 
B

BarryC

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.
 
B

BarryC

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!
 
K

Ken Snell \(MVP\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top