how to add a criterion in access

How to Add a Criterion in Access

By Nicole Lopez
AD

In the realm of data management, Microsoft Access offers a versatile platform to create and manipulate databases for both personal and professional use. One of the key features that sets Access apart is its ability to facilitate decision-making processes through criterion-based filtering and sorting. If you've found yourself wondering "how to add a criterion in Access," you're in the right place. This guide will walk you through the process, ensuring you're well-equipped to harness the power of criterion-based queries.

Before delving into the specifics, let's quickly recap what a criterion is in Access. A criterion, or query criterion, is a condition that defines the records to be included or excluded from a query. It's essentially the selection rule that dictates which data should be displayed or excluded based on certain parameters. With this in mind, let's get started on how to add a criterion in Access.

Adding a Criterion in the Criteria Row

A criterion can be added directly in the 'Criteria' row of the query grid. This method is straightforward and ideal for simple queries.

AD
Microsoft Access tips: Crosstab query tips
Microsoft Access tips: Crosstab query tips
MS Access - Controls & Properties
MS Access - Controls & Properties
Microsoft Access Beginner 1 - Computer Learning Zone
Microsoft Access Beginner 1 - Computer Learning Zone

Here's how to do it:

Using the Criteria Row

First, open your query in Design View. You'll see a grid with table fields listed in the Field column.

How to use Microsoft Access - Beginner Tutorial
How to use Microsoft Access - Beginner Tutorial
a poster with instructions on how to use microsoft access
a poster with instructions on how to use microsoft access
How to Create Custom Attributes in Active Directory?
How to Create Custom Attributes in Active Directory?

To add a criterion, click on the cell in the 'Criteria' row that corresponds to the field you want to filter. For instance, if you want to filter the 'Product' field, click on the cell in the 'Criteria' row under the 'Product' field.

Entering the Criterion

After clicking the cell, you'll be prompted to enter your criterion. For example, if you want to display only products from the 'Electronics' category, type "Electronics" and press Enter.

AD

The query will now show only the records that match the criterion 'Product = Electronics'.

Access Module 5 SAM Exam Walkthrough | Cengage MindTap
Access Module 5 SAM Exam Walkthrough | Cengage MindTap
the access 2007 instruction manual is shown in this file, with instructions to use it
the access 2007 instruction manual is shown in this file, with instructions to use it
MS Access - Formatting
MS Access - Formatting
MS Access Query Tutorial | Query Design Step by Step for Beginners | MS Access
MS Access Query Tutorial | Query Design Step by Step for Beginners | MS Access
MS Access - Create Form
MS Access - Create Form
Tip – Quick Access Toolbar in MS Office
Tip – Quick Access Toolbar in MS Office

Using the Criteria Builder

For more complex criteria, Access provides a built-in Criteria Builder tool. It allows you to combine multiple conditions using logical operators like AND, OR, and NOT.

Here's how to use it:

AD

Accessing the Criteria Builder

To access the Criteria Builder, click on the criteria cell as described earlier. Instead of typing your criterion directly, click on the dropdown arrow at the right end of the cell. You'll see options to select from: 'Is Not NULL', 'Is NULL', and 'Custom...'. Select 'Custom...'.

MS Access - Built-In Functions
MS Access - Built-In Functions
cisco
cisco
Microsoft Access Advanced Level 1 Tutorial Macros, Events
Microsoft Access Advanced Level 1 Tutorial Macros, Events

Building Your Criterion

In the 'Custom Condition' dialog box, you can build your criterion using the following options:

  • Field: Select the field you want to filter.
  • Operator: Choose the operator you want to use (e.g., '=', '>', '<', etc.).
  • Value: Enter the value that record must match to be included in the query.

You can add as many conditions as needed using the 'And' and 'Or' buttons. The conditions are then combined based on the selected operator.

AD

Once you've set your criterion, click 'OK' to close the dialog. Your criterion is now added to the query, and Access will filter the records accordingly.

Using Parameter Query to Add a Criterion

If you want users to enter a criterion at runtime, you can use a Parameter query.

Here's how you can set it up:

Adding a Parameter

In the query design grid, click on the cell in the 'Criteria' row you want to set a parameter for. Then, right-click and select 'Parameters...'.

In the 'Parameter' dialog box, give your parameter a name and a prompt. The prompt is the message that will be displayed to the user when the parameter is used (e.g., 'Enter category...').

Running the Parameter Query

To run the query, simply click 'Run' in the toolbar. Access will display a dialog asking for the value to be used for the parameter. The user enters the value, and the query filters the records based on that value.

Mastering how to add a criterion in Access is a significant step towards leveraging the software's power. It allows you to extract valuable information from your databases, driving informed decisions in your personal or professional life. Now that you've got the hang of it, explore, experiment, and enjoy the journey of discovering Access's capabilities!

AD