iif condition

R

RickK

I want to have a report display a response of YES or NO depending on whether a checkbox has been checked in the underlying table/form

In the relevant control on the report, I have tried the following expression in the properties-control source box; neither seem to work, as I get either "0" or "-1" returned on the report instead of YES or NO

iif([control name], YES, NO
iif([control name]=0, NO, YES

Should I be using some other expression? Or should the appropriate expression be put in the query builder screen upon which the report is based

Any help would be greatly appreciated

Rick Kani
 
C

Cheryl Fischer

Rick,

I would use the following in the query upon which your report is based:

ShowYesNo: iif([control name]=0, "No", "Yes")

hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


RickK said:
I want to have a report display a response of YES or NO depending on
whether a checkbox has been checked in the underlying table/form.
In the relevant control on the report, I have tried the following
expression in the properties-control source box; neither seem to work, as I
get either "0" or "-1" returned on the report instead of YES or NO.
iif([control name], YES, NO)
iif([control name]=0, NO, YES)

Should I be using some other expression? Or should the appropriate
expression be put in the query builder screen upon which the report is
based?
 
M

Marshall Barton

RickK said:
I want to have a report display a response of YES or NO depending on whether a checkbox has been checked in the underlying table/form.

In the relevant control on the report, I have tried the following expression in the properties-control source box; neither seem to work, as I get either "0" or "-1" returned on the report instead of YES or NO.

iif([control name], YES, NO)
iif([control name]=0, NO, YES)

Should I be using some other expression? Or should the appropriate expression be put in the query builder screen upon which the report is based?


Instead of using an expression in the text box's control
source, you can use a custom format in the text box's Format
property:

;"YES";"NO"
 

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