Use Conditional Formatting to Hide Error?

  • Thread starter Thread starter Mia
  • Start date Start date
M

Mia

I have a field on a report that returns all the correct calculations, except
for two entrys. That entry will never return a real answer because it is 0/0
& the other is 0/7. I would like to use conditional formatting to shade the
cells so you do not see these errors on the Report. Can anyone help me do
this? I am really bad ith VB so step by step would be greatly appreciated.

Thanks so much!
 
Hi Mia

Instead of conditional formatting, use a conditional calculation.

Let's say your calculation is [Num1]/[Num2].

You will get an error (divide by 0) if [Num2] is zero, so test for that
condition:

IIf( [Num2]=0, "", [Num1]/[Num2] )

This will display a blank if [Num2] is zero. To display something else
instead, just change the "".
 
Thanks a bunch that worked! And for the record I was using Access.

Thanks again

Graham Mandeno said:
Hi Mia

Instead of conditional formatting, use a conditional calculation.

Let's say your calculation is [Num1]/[Num2].

You will get an error (divide by 0) if [Num2] is zero, so test for that
condition:

IIf( [Num2]=0, "", [Num1]/[Num2] )

This will display a blank if [Num2] is zero. To display something else
instead, just change the "".
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Mia said:
I have a field on a report that returns all the correct calculations,
except
for two entrys. That entry will never return a real answer because it is
0/0
& the other is 0/7. I would like to use conditional formatting to shade
the
cells so you do not see these errors on the Report. Can anyone help me do
this? I am really bad ith VB so step by step would be greatly
appreciated.

Thanks so much!
 
Back
Top