IIf error display *

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

Guest

On very rare occasions a query used in a calculation may have no data. When
this happens I get an error message. I would like to have a * instead but,
my attempts to use an IIf statement are not working. Any suggestions would be
appreciated. thank-you
 
eb1mom said:
On very rare occasions a query used in a calculation may have no data. When
this happens I get an error message. I would like to have a * instead but,
my attempts to use an IIf statement are not working. Any suggestions would be
appreciated. thank-you

What have you done so far? Posting your existing code will help us to
identify what the problem is.

What's the error message? Posting the error message will help us to
identify what the problem is.

Sounds like a broken record doesn't it?

As a starting point, take a look at the NZ function in your help file.
You could have nulls in your data, which could force calculations which
require a number to fail. NZ will change the nulls to zeros. This can
still cause divide by zero issues if it is that kind of calculation.

Also look at IIF in the help system. The format is
=IIf({Expression which evaluates to true or false}, {Value if True},
{Value if False})

e.g. =Iif([MyField]=0, "*", [MyField])
 
Thank-you for your help. I tweaked the Iff example you gave to null and now
I have a * when no records.
 
Back
Top