Supress the #Error message

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

Guest

Hi,

I have a query that has a calculated field called PercentToTarget that
divides two fields. It equals RetailRatio/TargetRetailRatio. For some
people on the list, they have a target retail ratio of 0. So everyone who
has a target retail ratio of zero gets a #error message. This shows up in
the report that I create as well. I would like to make either a change in my
query or my report that leaves this field blank if there is a zero valule for
target retail ratio rather than this showing up in my report. Can someone
help?

Thanks,
 
ChuckW said:
I have a query that has a calculated field called PercentToTarget that
divides two fields. It equals RetailRatio/TargetRetailRatio. For some
people on the list, they have a target retail ratio of 0. So everyone who
has a target retail ratio of zero gets a #error message. This shows up in
the report that I create as well. I would like to make either a change in my
query or my report that leaves this field blank if there is a zero valule for
target retail ratio rather than this showing up in my report.


Two things to try. I suspect that one or the other will do
what you want.

In the query, change the calculated field to:
IIf(TargetRetailRatio=0,Null,RetailRatio/TargetRetailRatio)

Or, in the text box on the report that displays the percent,
use the expression:
=IIf(IsError(PercentToTarget),Null,PercentToTarget)
 
Back
Top