Using existing fields in an IIf statement

  • Thread starter Thread starter Keith Woollacott
  • Start date Start date
K

Keith Woollacott

I am trying to create a text field which displays an existing field is
another field is null. The expression I have used is:
=IIf([Home_Address]="",[Manager],Null). Unfortunately this doesn't work in
that nothing is ever displayed, even if there is nothing in the
[Home_Address] field.

If I replace the [Home_Address] field with some text (like "No Data") then
it works.

Help would be appreciated.
 
Try:
=IIf([Home_Address] Is Null,[Manager], Null)

Null is not the same thing as "" (a zero-length string.)

For more info, see:
Common erros 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.

message
news:[email protected]...
 
Allen - Very many thanks for your prompt and accurate response
--
Keith W


Allen Browne said:
Try:
=IIf([Home_Address] Is Null,[Manager], Null)

Null is not the same thing as "" (a zero-length string.)

For more info, see:
Common erros 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.

message
I am trying to create a text field which displays an existing field is
another field is null. The expression I have used is:
=IIf([Home_Address]="",[Manager],Null). Unfortunately this doesn't work in
that nothing is ever displayed, even if there is nothing in the
[Home_Address] field.

If I replace the [Home_Address] field with some text (like "No Data") then
it works.

Help would be appreciated.
 

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

Similar Threads

IIf statement 9
Access Building a IIF expression in Access 0
IIF Statement 2
IIF statement question 3
Problem with IIF statement 5
Switch Function w/nested IIf Functions 1
Sum a field with null value 5
Nested IIf statements 1

Back
Top