Discussion Locked

Report >> Expression #Num appear need to

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a report with a calculated field, the problem arises when I preview or print the report and one of the (2 in total) fields which it uses in the calculation is zero. This displaying the #Num! error. I need code to hide this expression (text box or label, not sure) if one of the two fields are equal to zero. I know that using the properties I can build code in the On Activate event. Please help.

4 replies

by gurnerworld

Can you use an If statement?

Something along the lines of
=if(field1="","",(field1*field2))

This will work in standard worksheet calculations and I think it will work in calculated fields - if it doesn't, then I apologise.

There is a function within Excel which is designed specifically for this problem which you might also like to try, which is ISERROR.

Hope this is useful.

by gurnerworld

Addition to the previous answer:

If the calculated field is January/february then the following will only do the calculation if it doesn't produce an error.

=IF(ISERROR(January/February),0,January/February)

The formula will return a zero ifthe calculation would return an error. I can't get it to return text - can someone else help here?

by hvanegas

I'm sorry for the confusion the report that I meant was for the MS Access Report object. I expecting something along the line of VBA code to enter into the On Print (or before) to get rid of these errors. Thanks anyway

This discussion is closed to new replies.