Example: Parameter Query

from LanguageArtsClasses.mdb

The query QCount of Test Grades by Class, groups the scores for an assignment or test based on the class and letter grade. A particular assignment/test ID has to be entered in the Criteria line. It is more flexible to have the query ask which assignment to look at.

Query Design View: Parameter Query

Dialog: Parameter message

By writing [Enter Assignment/Test ID#:] in the Criteria cell instead of entering a specific ID number, when the query runs, a dialog appears that repeats what was typed between the square brackets. When you fill in the value and click OK, the query runs, with the input as the criteria. A much more flexible query than before!

In this case the user had to know the ID number of the assignment or test that she wants to look at. You can also create a form with a Lookup field that will show you what the choices are. When the choices are not completely obvious or the list is long or there are multiple parameters, a form can make it much easier to enter the right values. Keep the brain strain to a minimum!

Lessons Databases Appendix

Teachers: Request permission to use this site with your class
Copyright 1997-2012 Jan Smith   <jegs1@jegsworks.com>
All Rights Reserved

Icon: DonwloadIcon: CDWant a local copy with no ads? - Download/CD

Want to help?

~~  1 Cor. 10:31 ...whatever you do, do it all for the glory of God.  ~~

Last updated: 30 Apr 2012