Article ID: 103181 - Last Review: January 18, 2007 - Revision: 2.1 ACC: Showing All Records (Including Null) in a Parameter QueryThis article was previously published under Q103181
Moderate: Requires basic macro, coding, and interoperability skills.
SUMMARY
When you run a query that takes its parameters from a form, no
records are returned by the query if you leave the field blank. If you
type an asterisk (*) in the field, only records with non-Null values
are returned.
This article describes a method you can use to return all records, including those with Null values, when you leave the parameter blank. NOTE: A demonstration of the technique used in this article can be seen in the sample file, Qrysmp97.exe. For information about how to obtain this sample file, please see the following article in the Microsoft Knowledge Base: 182568
(http://support.microsoft.com/kb/182568/EN-US/
)
ACC97: Microsoft Access 97 Sample Queries Available in Download Center
MORE INFORMATION
The following example is based on the sample database Northwind.mdb
(or NWIND.MDB in Microsoft Access 2.0 or earlier).
Where Region Like Forms![Pick Employees]!Region & "*"
Or Forms![Pick Employees]!Region Is Null
REFERENCES
For more information about this topic, search the Help Index for "like
operator," or ask the Microsoft Access 97 Office Assistant.
APPLIES TO
| Article Translations
|

Back to the top
