Microsoft Access
  Home arrow Microsoft Access arrow Getting to Know Microsoft Access, Part 6: ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MICROSOFT ACCESS

Getting to Know Microsoft Access, Part 6: Advanced Queries and SQL
By: Sage Adams
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 18
    2005-01-12

    Table of Contents:
  • Getting to Know Microsoft Access, Part 6: Advanced Queries and SQL
  • AutoLookup Queries
  • Update Queries
  • Delete Queries
  • SQL (Structured Query Language)

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Getting to Know Microsoft Access, Part 6: Advanced Queries and SQL


    (Page 1 of 5 )

    This week we’re going to take queries to another level. We discussed the commonly used select query in last week’s tutorial. This week we’ll discuss some other ways to retrieve data as well as other query operations that allow for updating, adding, and deleting data. We’ll start this lesson with a look at some special purpose queries: parameter and autolookup queries. After that we’ll discuss the action queries update, append, make-table, and delete.

    Special Purpose Queries

    The first type of special purpose query we’ll look at is the parameter query. The parameter query is similar to the select query except that, where the select query is static, the parameter query prompts the user for selection criteria before running. The second type of special purpose query we’ll look at is the AutoLookup query, which fills in values for you in related tables, saving data entry time.

    Parameter Queries

    Parameter queries are especially useful for finding activities that fall within a certain time period. You can use multiple parameters in a query and Access will prompt the user for each one.

    To create a parameter query just begin with a select query by clicking the New Query button, selecting Design View in the dialog box, and selecting your table(s) or query(ies) from which to select data, like so:

    Microsoft Access Part 6: Advanced Queries and SQL

    Then, instead of entering criteria in the Criteria cell as you would in a standard select query, just enter the parameter text enclosed in brackets ( [ ] ). This text will make up the prompt the user is given when the query is run, as in the following screenshot that asks the user for the Category Name:

    Microsoft Access Part 6: Advanced Queries and SQL

    Besides asking the user for a basic text answer, you could also prompt them for a specific time period using the syntax Between…And in the Criteria cell in brackets. For example:

    Between [Enter start date] And [Enter end date]

    Select any other fields you want to appear in the query results by dragging the fields from the field list and putting them in the query grid in the appropriate places.

    The default data type for a parameter query is text, but you can change that, for example, to a number data type by choosing the Query | Parameters menu option while in Query design view. In the dialog box that appears, enter the parameter precisely as it appears in the Criteria cell and select the appropriate data type, such as the number data type.

    More Microsoft Access Articles
    More By Sage Adams


     

    MICROSOFT ACCESS ARTICLES

    - Linking SQL Express 2005 Tables to MS Access...
    - Working with Access Projects in Access 2007
    - Exploring Access 2007
    - Working with Stored Procedures in an MS Acce...
    - Creating and Using Action Queries
    - Creating Data Access Pages with Charts using...
    - Advanced Ideas using VBA
    - VBA Details
    - Updating Records in MS Access
    - Using ADO`s Record Object with URLs
    - Exporting XML from MS Access 2003
    - Importing XML into MS Access 2003
    - On Using Pass-through Queries in MS Access
    - Distributed Queries in MS Access
    - Configuring a Linked Microsoft Access Server...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway