How To

How to Execute a Query in Access

Contributor
By C.D. Crowder
eHow Contributing Writer
(0 Ratings)

Microsoft Access allows you to create databases complete with powerful queries and reports. You can execute an Access query at any time through the easy-to-use Access toolbar. There are also numerous other ways to execute an Access query. By executing a query after creation, you can ensure the query works as you intended. The process of executing a query takes anywhere from a few seconds to almost a minute, depending on the size of your database.

Difficulty: Easy
Instructions
  1. Step 1

    Open a Microsoft Access database. You can create a new one as well, if need be.
    To create a new database, open Microsoft Access, go to "File" and choose "New." Click "Blank Database." Choose a name for your database to finish the creation process.

  2. Step 2

    Click "Queries" in the database window. If you're creating a new database, you will need to create at least one table and one query before continuing. Use the wizards in both the "Tables" and "Queries" sections to quickly create basic tables and queries.

  3. Step 3

    Single-click any query. Click "Design View." This will open the query so you can edit it if necessary.

  4. Step 4

    Click the red exclamation point ("!") on the query toolbar above the design view window. This will execute your query and display your results. Update, Append and Delete queries will not display results. To see their results, open the table or tables the query was intended to edit to ensure the correct number of records is showing or if the proper edits have been made.
    If your query has parameters, you will need to enter each parameter as it appears in order for the query to execute.

  5. Step 5

    Double-click any query, as an alternative, to execute it.

  6. Step 6

    Execute a query through a button, form or report close, or another event in addition to the above process. This will depend solely on each individual database. Right-click anywhere on your form or report, and choose "Properties" to add the run query code to the necessary event.
    Queries can be executed by almost any event in the properties in a form or report.

Tips & Warnings
  • Execute every query immediately after creation to ensure they work as intended. This makes the troubleshooting process easier by eliminating which objects you need to check should errors occur.
  • When testing queries that edit your tables, create a backup copy of the database to prevent any data loss until the query is set up correctly.
Resources

Post a Comment

Post a Comment
  • Have you done this? Click here to let us know.
I Did This

Related Ads

Computers
Alexia Petrakos,

Meet Alexia Petrakos eHow's Computers Expert.

Get Free Computers Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US

eHow Computers
eHow_eHow Technology and Electronics