Monday, March 26, 2012

Using A parameter query

A parameter query enable you to reuse the same query but with different criteria each time. Every time a parameter query is run it prompts the user for the search criteria. This feature allows inexperienced users to query to database without having to actually create the query.

  1. Create a query using the Design View.
  2. In query Design view, drag the fields from the field list to the query design grid.

3.      In the Criteria cell for each field you want to use as a parameter, type an expression with a prompt enclosed in square brackets. To prompt the user for one or more characters to search for, and then find records that begin with or contain the characters the user specifies, create a parameter query that uses the LIKE operator and the wildcard symbol (*).

For example, the following statement searches for words that begin with a specified letter:

LIKE [Enter the first character to search by: ] & "*"

The phrase inside the square brackets is the prompt that the user will see.

The following  statement searches for words that contain the specified character: 


LIKE "*" & [Enter any character to search by: ] & "*"

No comments:

Post a Comment