If Statement

G

Glenn Dulmage

I have a Checkbox field [Membership 04-05] which returns a 0 or a 1
depending on whether it is checked. I am trying to print a label in which I
would like a YES or NO to appear instead of the 0 or 1. I have tried the
following:

="Member:" & IIf(([Membership 04-05])="1","","YES") or IIf(([Membership
04-05])="0","","NO")

Surprise, surprise - it doesn't work. Can anyone help?

Thanks
--
Glenn T. Dulmage
207 Valley Road
Chestertown MD 21620
410-778-5166
(e-mail address removed)
 
G

Glenn Dulmage

WOW! Not only works like a charm, but your answer came back in less than 10
minutes!!

Question: why the -1 after the = ?

I can't thank you enough


Lynn Trapp said:
Try it this way instead.

="Member:" & IIf([Membership 04-05]= -1,"YES","NO")

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Glenn Dulmage said:
I have a Checkbox field [Membership 04-05] which returns a 0 or a 1
depending on whether it is checked. I am trying to print a label in which I
would like a YES or NO to appear instead of the 0 or 1. I have tried the
following:

="Member:" & IIf(([Membership 04-05])="1","","YES") or IIf(([Membership
04-05])="0","","NO")

Surprise, surprise - it doesn't work. Can anyone help?

Thanks
--
Glenn T. Dulmage
207 Valley Road
Chestertown MD 21620
410-778-5166
(e-mail address removed)
 
L

Lynn Trapp

You're quite welcome.

In Access the values of a boolean (yes/no) field are 0 = False and -1 =
True.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Glenn Dulmage said:
WOW! Not only works like a charm, but your answer came back in less than 10
minutes!!

Question: why the -1 after the = ?

I can't thank you enough


Lynn Trapp said:
Try it this way instead.

="Member:" & IIf([Membership 04-05]= -1,"YES","NO")

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Glenn Dulmage said:
I have a Checkbox field [Membership 04-05] which returns a 0 or a 1
depending on whether it is checked. I am trying to print a label in
which
I
would like a YES or NO to appear instead of the 0 or 1. I have tried the
following:

="Member:" & IIf(([Membership 04-05])="1","","YES") or IIf(([Membership
04-05])="0","","NO")

Surprise, surprise - it doesn't work. Can anyone help?

Thanks
--
Glenn T. Dulmage
207 Valley Road
Chestertown MD 21620
410-778-5166
(e-mail address removed)
 
S

Sprinks

Hi,

Hi, Glenn. Assuming that 1 corresponds to "YES", try:

="Member:" & IIf(([Membership 04-05])="1","YES","NO")

The syntax of IIF function is IIF(booleanstatement,value if true,value if
false).

Hope that helps.
Sprinks
 

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

Update Query? 4
Update Query 6
Query to capture AOL accounts 2
Table design 7
Count the number of occurennces of Zip Code 2
Zip Code Count 6
Date Brackets as an IIf statement 3
crosstab report layout? 2

Top