User Input Parameter for Yes/No datatype

  • Thread starter Thread starter Jerry M. Gartner
  • Start date Start date
J

Jerry M. Gartner

Greetings:

When constructing a select query using the query design view (as opposed
to sql), one of the datatypes is a yes/no field. If I enter "Yes" or "No"
in the criteria I get the expected records to return. When adding a user
input parameter [Foo Yes/No], the words "Yes" and "No" no longer work,
instead a 0 or a 1 must be entered. In an effort to make this as user
friendly as possible, I'd really like "Yes" or "No" to work. I'm a bit of
an access newbie so I figure that I'm probably over looking something
simple. Good advice is much appreciated.
 
Hi Jerry,

If you enter a query parameter, you will be able to use your desired
criteria. To do this, click on Query > Parameters... in query design view.
Enter the same exact criteria, making sure that you do not include a leading
space. Set the data type to a Yes/No field. Then try running your query.

The resulting SQL statement will look something like this (this one for the
Products table in the sample Northwind database):

PARAMETERS [Foo Yes/No] Bit;
SELECT Products.ProductName, Products.Discontinued
FROM Products
WHERE (((Products.Discontinued)=[Foo Yes/No]));


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

:

Greetings:

When constructing a select query using the query design view (as opposed
to sql), one of the datatypes is a yes/no field. If I enter "Yes" or "No"
in the criteria I get the expected records to return. When adding a user
input parameter [Foo Yes/No], the words "Yes" and "No" no longer work,
instead a 0 or a 1 must be entered. In an effort to make this as user
friendly as possible, I'd really like "Yes" or "No" to work. I'm a bit of
an access newbie so I figure that I'm probably over looking something
simple. Good advice is much appreciated.
 
Greetings again:

While I'm asking about query parameters, can I use a combo box (drop
down) to give the user a few options?
 
Yes. Use a criteria that looks something like this:

=Forms!FormName!ControlName

where FormName is the name of your form (which must be open) and ControlName
is the name of your combo box. The bound column will determine the value
picked up in the query criteria. You don't necessarily have to display the
bound column; you can set its display width to zero.

I have an example that I can send to you, if you send me a private e-mail
message with a valid reply-to address. My e-mail address is available at the
bottom of the contributors page, indicated below in my signature. Please do
not post your e-mail address (or mine) to a newsgroup reply.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________


Jerry M. Gartner said:
Greetings again:

While I'm asking about query parameters, can I use a combo box (drop
down) to give the user a few options?

--

Regards,

Jerry M. Gartner

Jerry M. Gartner said:
Greetings:

When constructing a select query using the query design view (as
opposed to sql), one of the datatypes is a yes/no field. If I enter "Yes"
or "No" in the criteria I get the expected records to return. When adding
a user input parameter [Foo Yes/No], the words "Yes" and "No" no longer
work, instead a 0 or a 1 must be entered. In an effort to make this as
user friendly as possible, I'd really like "Yes" or "No" to work. I'm a
bit of an access newbie so I figure that I'm probably over looking
something simple. Good advice is much appreciated.

--

Regards,

Jerry M. Gartner
 

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

Back
Top