calculated field, changing value for check box in report

  • Thread starter Thread starter buscher75
  • Start date Start date
B

buscher75

I am trying to add a checkbox to a report. I want it to show a checkmark if
there is a specific value entered into the coordinating field in a table. I
added a calculated field to the query, but of course I do not know enough to
get it right. If the value of "test" field is "issues" then a true/false,
yes/no, null/not null value is returned, right?

Here is my code
Expr1: Iff([TEST]="ISSUES",-1,0)

Thanks.
 
Does the query run correctly by itself?

Do you have a checkbox on the form with a control source of Expr1? Note
Text but Expr1.
 
No the query does not run correctly. It gives me an "undefined function in
IIF expression" error and will not exicute the query.

Jerry Whittle said:
Does the query run correctly by itself?

Do you have a checkbox on the form with a control source of Expr1? Note
Text but Expr1.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


buscher75 said:
I am trying to add a checkbox to a report. I want it to show a checkmark if
there is a specific value entered into the coordinating field in a table. I
added a calculated field to the query, but of course I do not know enough to
get it right. If the value of "test" field is "issues" then a true/false,
yes/no, null/not null value is returned, right?

Here is my code
Expr1: Iff([TEST]="ISSUES",-1,0)

Thanks.
 
Try using
IIF in place of IFF

IIf([TEST]="ISSUES",-1,0)

Or even simpler, since you want a boolean value returned might be the
following. It will return NULL if Test is Null, but otherwise it will return
true or false

Expr1: [Test] = "Issues"

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
No the query does not run correctly. It gives me an "undefined function in
IIF expression" error and will not exicute the query.

Jerry Whittle said:
Does the query run correctly by itself?

Do you have a checkbox on the form with a control source of Expr1? Note
Text but Expr1.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


buscher75 said:
I am trying to add a checkbox to a report. I want it to show a checkmark if
there is a specific value entered into the coordinating field in a table. I
added a calculated field to the query, but of course I do not know enough to
get it right. If the value of "test" field is "issues" then a true/false,
yes/no, null/not null value is returned, right?

Here is my code
Expr1: Iff([TEST]="ISSUES",-1,0)

Thanks.
 
Great Catch!
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


John Spencer said:
Try using
IIF in place of IFF

IIf([TEST]="ISSUES",-1,0)

Or even simpler, since you want a boolean value returned might be the
following. It will return NULL if Test is Null, but otherwise it will return
true or false

Expr1: [Test] = "Issues"

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
No the query does not run correctly. It gives me an "undefined function in
IIF expression" error and will not exicute the query.

Jerry Whittle said:
Does the query run correctly by itself?

Do you have a checkbox on the form with a control source of Expr1? Note
Text but Expr1.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

I am trying to add a checkbox to a report. I want it to show a checkmark if
there is a specific value entered into the coordinating field in a table. I
added a calculated field to the query, but of course I do not know enough to
get it right. If the value of "test" field is "issues" then a true/false,
yes/no, null/not null value is returned, right?

Here is my code
Expr1: Iff([TEST]="ISSUES",-1,0)

Thanks.
 
That was it, it works fine. Thanks.

Jerry Whittle said:
Great Catch!
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


John Spencer said:
Try using
IIF in place of IFF

IIf([TEST]="ISSUES",-1,0)

Or even simpler, since you want a boolean value returned might be the
following. It will return NULL if Test is Null, but otherwise it will return
true or false

Expr1: [Test] = "Issues"

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
No the query does not run correctly. It gives me an "undefined function in
IIF expression" error and will not exicute the query.

:

Does the query run correctly by itself?

Do you have a checkbox on the form with a control source of Expr1? Note
Text but Expr1.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

I am trying to add a checkbox to a report. I want it to show a checkmark if
there is a specific value entered into the coordinating field in a table. I
added a calculated field to the query, but of course I do not know enough to
get it right. If the value of "test" field is "issues" then a true/false,
yes/no, null/not null value is returned, right?

Here is my code
Expr1: Iff([TEST]="ISSUES",-1,0)

Thanks.
 
Back
Top