Iif and Conditional Formatting

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

Guest

I have a field, "Guarantor", that needs to use conditional formatting to
shade itself gray. The conditions under which this should occur are if the
field "Guarantor" is null and the field "Cat Code" (which is in the query on
which the report is based, but not included in the report) is equal to "C".
Access doesn't like the following expression, which I'm entering in the
"Expression Is" box of the conditional format:

Iif([Guarantor] Is Null AND [Cat Code] = C)

What am I doing wrong?
 
Try
[Guarantor] Is Null AND [Cat Code] = "C"
or
IsNull([Guarantor]) AND [Cat Code] = "C"
 
Gwen said:
I have a field, "Guarantor", that needs to use conditional formatting to
shade itself gray. The conditions under which this should occur are if the
field "Guarantor" is null and the field "Cat Code" (which is in the query on
which the report is based, but not included in the report) is equal to "C".
Access doesn't like the following expression, which I'm entering in the
"Expression Is" box of the conditional format:

Iif([Guarantor] Is Null AND [Cat Code] = C)

What am I doing wrong?


Get rid of the "IIf"

A Conditional Formatting - Expression Is entry is evaluated
as a True/False expression, so the format's properties will
be applied if the expression is True, no need for IIf here.
 
Thanks so much!

Duane Hookom said:
Try
[Guarantor] Is Null AND [Cat Code] = "C"
or
IsNull([Guarantor]) AND [Cat Code] = "C"



--
Duane Hookom
MS Access MVP
--

Gwen H said:
I have a field, "Guarantor", that needs to use conditional formatting to
shade itself gray. The conditions under which this should occur are if the
field "Guarantor" is null and the field "Cat Code" (which is in the query
on
which the report is based, but not included in the report) is equal to
"C".
Access doesn't like the following expression, which I'm entering in the
"Expression Is" box of the conditional format:

Iif([Guarantor] Is Null AND [Cat Code] = C)

What am I doing wrong?
 
Back
Top