Parameter Query In MS Access

Creating a Parameter Query In MS Access 2007

Query is request to DBMS for accessing the information and parameter is a variable which tell to query that which specific of information are required. A parameter query is a SQL command When a parameter query run then its show a prompt to user and ask what you want to search. when user input some criteria then the result will be shown according to your given criteria. For example

 For Example:

if we have a table with student fee record and we want to display the fee record of one specific student rather then all record then we use a parameter query. In which we pass the student name as parameter which show the specific record of that student.

  • Step involve in creating a Parameter Query

    Open You database file in Access 2007.

    Click on Create Manu Tab form Office Ribbon then Select the Queries Wizard icon Form Other group.

    In appearing dialog box select Simple Query Wizard.

In Next appearing dialog box select the table from which you want to build query.

Click a field name in the Available Fields list, then click the Add (>) button to move the field name to the Selected Fields list. You can also Add all field by clicking Add All (>>) button.

In Next dialog box Give the Title of your query and Select Modify the query in design view.

  • Now locate the field that you would like to include variable criteria, and place your cursor in the Criteria row.

  • Parameter Query

  • Type the phrase you would like to appear in the prompt that will pop up every time you run your query. This phrase must enclose in brackets [ ].

  •  For example, in our parameter query that searches for Student fee Record , we might type our criteria like [Enter Student ID?].

  • On the Query Design tab, click the Run command to run your query.

  • A dialog box will appear with the prompt you specified.

  • Enter Student ID.

  • Click OK to view your query results.

  • Parameter Query