Iif and Conditional Formatting

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?
 
D

Duane Hookom

Try
[Guarantor] Is Null AND [Cat Code] = "C"
or
IsNull([Guarantor]) AND [Cat Code] = "C"
 
M

Marshall Barton

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.
 
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top