I have a form called "Search" on which there are a number of unbound text field. The idea is this: the user types in information on a subject (like first name, last name, Date of Birth etc) and then hits search. The form calls a query named qMasterSearch. The search results are displayed in the FormFooter of the Search form. In the relative field criteria box of the query, I have put in: Like [Forms]![Search]![Ben_Zip] & "*" So long as the corresponding field in the form has something, it works perfect. The problem is we don't always have all of the information for each record resulting in tons of blank fields. What we need, therefore, is a way to run the query with what every information is there but if the form field is blank just display all of the records. I tried to use "*" in If null statement. However, this excludes null fields. I also tried using Form Filter in vb on the Search form with if nz() statements. However, because of the size of the database (70 million plus records--I have no control over this) it first tries to pull all of the records first before applying the filter. With the large number of records, this does not work.
Basically, I need some way to run a query and when a field is blank on the Search form the query understands that it is to display all records for that column. Can someone please help me? You have no idea how important this project is. Thanks.
Basically, I need some way to run a query and when a field is blank on the Search form the query understands that it is to display all records for that column. Can someone please help me? You have no idea how important this project is. Thanks.