| DatabaseLessons.com |
'Serving the Microsoft® Access |
|
|
Query Parameters - Part 2In part 1 of this article (click here to read it) we learned how an Microsoft® Access form could be used to collect criteria information for a query. (article continues after sponsor spot) What if we want to allow the user to enter only part of a string, or no string at all? The first version would allow for partial word criteria, the second would, in effect, create a query with no criteria. If it is a text field, this version will do the trick: Like "*" & [forms]![myform]![myfield] & "*" If we are using combo boxes or list boxes to pick from before running the query, we have to allow for a user not picking anything. This may be, in effect, a request to list all records. Use this style: [forms]![myform]![myfield] or [forms]![myform]![myfield] is null This method can be used with regular text boxes as well. Part 3 of this series is here. Happy Coding |
|
|
© 2006, 2007 Richard W. Killey. All Rights Reserved. |