criteria on yes/no

G

Guest

I have a report which I obtain the info from a table using a select query.
One of the fields in the table is a yes/no field. I like to write a criteria
which will prompt a user to type in "yes", "no" or blank in that select
query.

For example, if a user types in "yes", it will show all the records from the
table with "checks" in the field, and if blank, it will show all the records
(both yes and no).

I have a similar criteria for student id. Below is the code. I would like
to write something similar to it.

Like nz([Please Enter Student ID],"*")

Thanks.
 
F

fredg

I have a report which I obtain the info from a table using a select query.
One of the fields in the table is a yes/no field. I like to write a criteria
which will prompt a user to type in "yes", "no" or blank in that select
query.

For example, if a user types in "yes", it will show all the records from the
table with "checks" in the field, and if blank, it will show all the records
(both yes and no).

I have a similar criteria for student id. Below is the code. I would like
to write something similar to it.

Like nz([Please Enter Student ID],"*")

Thanks.

WHERE YourTable.CheckBox = IIf([What]="Yes",-1,0) OR [What] Is Null;
 
G

Guest

fredg,

Thanks. It works.

fredg said:
I have a report which I obtain the info from a table using a select query.
One of the fields in the table is a yes/no field. I like to write a criteria
which will prompt a user to type in "yes", "no" or blank in that select
query.

For example, if a user types in "yes", it will show all the records from the
table with "checks" in the field, and if blank, it will show all the records
(both yes and no).

I have a similar criteria for student id. Below is the code. I would like
to write something similar to it.

Like nz([Please Enter Student ID],"*")

Thanks.

WHERE YourTable.CheckBox = IIf([What]="Yes",-1,0) OR [What] Is Null;
 

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