calculated field, changing value for check box in report

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.
 
J

Jerry Whittle

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.
 
B

buscher75

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.
 
J

John Spencer

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.
 
J

Jerry Whittle

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.
 
B

buscher75

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.
 

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