Iff Question (Should be simple but I can't see to get it right!!)

  • Thread starter Thread starter Chas
  • Start date Start date
C

Chas

Okay what i am trying to do is to get the form to show something like this:
The "Spouse:" part should only show up if there is something in the
[Significantother] field..

So the desired result is

Spouse: Significantother

I thought this would do it which does show the name of the significantother
but doesn't include the Spouse:
=IIf([SIGNIFICANTOTHER]=Not Null,"Spouse:",[Significantother])

What am I missing?
 
I think you have it backwards --
=IIf([SIGNIFICANTOTHER] Is Null,"Spouse:",[Significantother])
 
Okay what i am trying to do is to get the form to show something like this:
The "Spouse:" part should only show up if there is something in the
[Significantother] field..

So the desired result is

Spouse: Significantother

I thought this would do it which does show the name of the significantother
but doesn't include the Spouse:
=IIf([SIGNIFICANTOTHER]=Not Null,"Spouse:",[Significantother])

What am I missing?


This part is incorrect. (=Not Null)
A field can be Not Null but it cannot be = Not Null.

You can use either:
=IIf(IsNull([SIGNIFICANTOTHER]),"Spouse:",[Significantother])

Or...
=IIf([SIGNIFICANTOTHER] Is Null,"Spouse:",[Significantother])

If you wish to reverse the Is Null logic you would use either
= IIf(Not IsNull([FieldName]), etc...)
or
= IIf([FieldName] Is Not Null, etc...)
 
Back
Top