iif condition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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?
 
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"
 
Back
Top