IIF - Trouble with NULLS

  • Thread starter Thread starter Larry G
  • Start date Start date
L

Larry G

I,m using two bound text fields to create a thrid unbound field they are:

2 bound to same table - [contractnum] and [fmscase] - both are text, format
= >, required = no, allow zero lenght = no, indexed = yes (dups ok).

The 3rd unbound field is [contract or fms no.] in it's control source I'm
using the following:

"=IIF([contractnum]=null,[fmscase],[contractnum])"

The above simply doesn't work and I'm not sure why.

The goal is to have the 3rd field show either the contract no. or the
fmscase no (one or the other) - if there is a contract no there will not be
an fms case no. or vise versa.

Any help would be greatly appreciated.

THANKS...

Larry G.
 
Allen,

THANKS!! - WORKED FINE...Regards, Larry

Allen Browne said:
Nothing is ever equal to Null.

Try:
=IIF([contractnum] Is Null,[fmscase],[contractnum])

For an explanation of why, see Error #5 in:
Common Errors with Null
at:
http://allenbrowne.com/casu-12.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Larry G said:
I,m using two bound text fields to create a thrid unbound field they are:

2 bound to same table - [contractnum] and [fmscase] - both are text,
format
= >, required = no, allow zero lenght = no, indexed = yes (dups ok).

The 3rd unbound field is [contract or fms no.] in it's control source I'm
using the following:

"=IIF([contractnum]=null,[fmscase],[contractnum])"

The above simply doesn't work and I'm not sure why.

The goal is to have the 3rd field show either the contract no. or the
fmscase no (one or the other) - if there is a contract no there will not
be
an fms case no. or vise versa.

Any help would be greatly appreciated.

THANKS...

Larry G.
 
Back
Top