the Manx Man's MS Access Pages
to subscribe - click here

-- advertisement --
eltvb.gif (2918 bytes)
Click on the above image to learn how you
can make a projection TV for as little as $20.

Using a Form to pass Parameters to a Query - Part 2 (017)

In part 1 of this article (click here to read it) we learned how a form could be used to collect criteria information for a query.

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.

The next article in this series will look at using multiple criteria for a single field. For example, I want a report showing clients # 3, 6, and 14.  See it in tip043.

e-mail the manx man index of tips click here for a laugh profit from the web

tip # 017  ||  previous tip  ||  next tip