Using Null and Not Null in IIF Statement

A

April

I am trying to get the following Formula to work and I
don't know what I need to do? Can You help, this is what
I have:

IIf(([SIZE-KB-GW]=Null) Or ([ANumber-ADT]=Null) Or
([SMTP]=Null) Or ( [Comments]<> Null) ,"Y","")

Simply Put: IF
[Size-KB-GW] is Blank OR
[ANumber-ADT] is Blank OR
[SMTP] is Blank OR
[Comments] is not Blank
Then Place a "Y" in the [DiffRept] (This is a checkbox
field) otherwise do noting.

Thanks so Much.... April
 
J

Jen

Hi April,

Access doesn't recognize the Or clause in an IIf
statement. Try the following:

DiffRept: IIf(IsNull([SIZE-KB-GW]), "Y", IIf(IsNull
(ANumber-ADT]), "Y", IIf(IsNull([SMTP]), "Y", IIf(IsNull
([Comments]) = False, "Y", ""))))

Regards,
Jen
 
D

Duane Hookom

IIf() does allows ORs and ANDs. Try:

IIf(IsNull([SIZE-KB-GW]) Or IsNull([ANumber-ADT]) Or IsNull([SMTP]) Or Not
IsNull([Comments]) ,"Y","")


--
Duane Hookom
MS Access MVP


Jen said:
Hi April,

Access doesn't recognize the Or clause in an IIf
statement. Try the following:

DiffRept: IIf(IsNull([SIZE-KB-GW]), "Y", IIf(IsNull
(ANumber-ADT]), "Y", IIf(IsNull([SMTP]), "Y", IIf(IsNull
([Comments]) = False, "Y", ""))))

Regards,
Jen
-----Original Message-----
I am trying to get the following Formula to work and I
don't know what I need to do? Can You help, this is what
I have:

IIf(([SIZE-KB-GW]=Null) Or ([ANumber-ADT]=Null) Or
([SMTP]=Null) Or ( [Comments]<> Null) ,"Y","")

Simply Put: IF
[Size-KB-GW] is Blank OR
[ANumber-ADT] is Blank OR
[SMTP] is Blank OR
[Comments] is not Blank
Then Place a "Y" in the [DiffRept] (This is a checkbox
field) otherwise do noting.

Thanks so Much.... April
.
 
A

April

Thanks I'll Try this and let you know
-----Original Message-----
Hi April,

Access doesn't recognize the Or clause in an IIf
statement. Try the following:

DiffRept: IIf(IsNull([SIZE-KB-GW]), "Y", IIf(IsNull
(ANumber-ADT]), "Y", IIf(IsNull([SMTP]), "Y", IIf(IsNull
([Comments]) = False, "Y", ""))))

Regards,
Jen
-----Original Message-----
I am trying to get the following Formula to work and I
don't know what I need to do? Can You help, this is what
I have:

IIf(([SIZE-KB-GW]=Null) Or ([ANumber-ADT]=Null) Or
([SMTP]=Null) Or ( [Comments]<> Null) ,"Y","")

Simply Put: IF
[Size-KB-GW] is Blank OR
[ANumber-ADT] is Blank OR
[SMTP] is Blank OR
[Comments] is not Blank
Then Place a "Y" in the [DiffRept] (This is a checkbox
field) otherwise do noting.

Thanks so Much.... April
.
.
 
J

John Spencer (MVP)

Pardon me for jumping in, but instead of "Y", shouldn't we be returning TRUE and
False vice "". The OP did say something about a checkbox.

Duane said:
IIf() does allows ORs and ANDs. Try:

IIf(IsNull([SIZE-KB-GW]) Or IsNull([ANumber-ADT]) Or IsNull([SMTP]) Or Not
IsNull([Comments]) ,"Y","")

--
Duane Hookom
MS Access MVP

Jen said:
Hi April,

Access doesn't recognize the Or clause in an IIf
statement. Try the following:

DiffRept: IIf(IsNull([SIZE-KB-GW]), "Y", IIf(IsNull
(ANumber-ADT]), "Y", IIf(IsNull([SMTP]), "Y", IIf(IsNull
([Comments]) = False, "Y", ""))))

Regards,
Jen
-----Original Message-----
I am trying to get the following Formula to work and I
don't know what I need to do? Can You help, this is what
I have:

IIf(([SIZE-KB-GW]=Null) Or ([ANumber-ADT]=Null) Or
([SMTP]=Null) Or ( [Comments]<> Null) ,"Y","")

Simply Put: IF
[Size-KB-GW] is Blank OR
[ANumber-ADT] is Blank OR
[SMTP] is Blank OR
[Comments] is not Blank
Then Place a "Y" in the [DiffRept] (This is a checkbox
field) otherwise do noting.

Thanks so Much.... April
.
 
D

Duane Hookom

Good catch.

--
Duane Hookom
MS Access MVP


John Spencer (MVP) said:
Pardon me for jumping in, but instead of "Y", shouldn't we be returning TRUE and
False vice "". The OP did say something about a checkbox.

Duane said:
IIf() does allows ORs and ANDs. Try:

IIf(IsNull([SIZE-KB-GW]) Or IsNull([ANumber-ADT]) Or IsNull([SMTP]) Or Not
IsNull([Comments]) ,"Y","")

--
Duane Hookom
MS Access MVP

Jen said:
Hi April,

Access doesn't recognize the Or clause in an IIf
statement. Try the following:

DiffRept: IIf(IsNull([SIZE-KB-GW]), "Y", IIf(IsNull
(ANumber-ADT]), "Y", IIf(IsNull([SMTP]), "Y", IIf(IsNull
([Comments]) = False, "Y", ""))))

Regards,
Jen

-----Original Message-----
I am trying to get the following Formula to work and I
don't know what I need to do? Can You help, this is
what
I have:

IIf(([SIZE-KB-GW]=Null) Or ([ANumber-ADT]=Null) Or
([SMTP]=Null) Or ( [Comments]<> Null) ,"Y","")

Simply Put: IF
[Size-KB-GW] is Blank OR
[ANumber-ADT] is Blank OR
[SMTP] is Blank OR
[Comments] is not Blank
Then Place a "Y" in the [DiffRept] (This is a checkbox
field) otherwise do noting.

Thanks so Much.... April
.
 

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