| DatabaseLessons.com |
'Serving the Microsoft® Access |
|
|
Query Parameters - Part 1Early in my career as a programmer of databases that used Microsoft® Access, I learned how to put parameters in a query, simply by placing words inside square brackets in the criteria row in the query designer. For example, [Enter the required Dept Code]. Then, when you run the query within MS Access, it asks for data input, using the words as a prompt. (article continues after sponsor spot) Well, it did not take me long to want to make this simpler. For one, if you had 2 or more parameters they were asked for one at a time. How could I get them to both be asked for at the same time in 2 text boxes?
Then I saw an article on using a form for this.
Here is the style I have developed for myself.
That's it. And, no VBA coding was required. The form method also allows you to do more thorough validity check, but using any methods available to forms, including some VBA. As an added bonus, you can use the query without the form. It will revert to a regular parameter query, asking for parameters with the names of the fields. Happy Coding |
|
|
© 2006, 2007, 2008 Richard W. Killey. All Rights Reserved. |