Microsoft KB Archive/198626

= ACC2000: Parameter Query on Yes/No Field That Accepts Yes, No, and * =

Article ID: 198626

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q198626



This article applies only to a Microsoft Access database (.mdb).

Novice: Requires knowledge of the user interface on single-user computers.



SUMMARY
This article describes how to create a parameter query that uses a Yes/No data type field that accepts the values of Yes, No, and * (asterisk), where * returns all values in the field.



MORE INFORMATION
To create a parameter query that displays all records that contain Yes, No, or all values, follow these steps:  Open the sample database Northwind.mdb. In the Database window, click Queries under Objects, and then click New. In the New Query dialog box, click Design View and click OK. In the Show Table dialog box, select the Products table, click Add, and then click Close. In the first column in the QBE grid, type the following:

Field: MyParam: IIf([Discontinued]=-1, "Yes","No")

Show: True

Criteria: Like [Enter Yes, No or *]

 On the Query menu, click Run.</li> Note that you are prompted with the Enter Parameter Value box. You can enter Yes, No, or *, where * returns all values.</li></ol>

<div class="references_section">