Ad hoc search for data to report

J

John Hipskind

I have a dialog box that feeds values to a query, which
in turn is the basis for a report.

Every field in the query is referenced to a text box on
the dialog. If I know what I'm looking for in any
particluar field, I enter that value in the dialog's text
box. The other text boxes are left empty. I then want the
query to find ALL records that include matches to my
ENTERED values.

For example:
A query with FirstName, LastName, and Age as its fields.
The dialog box that feed values to this query includes
text boxes for all 3 fields.
I know that I want to find all people named "John" who
are 34 years old, regardless of their LastName, so I
enter "John" and "34" in the respective text boxes of the
dialog. The LastName text box is left empty.

Here is my problem...
Regardless of what I've tried, the query accepts the null
LastName value in the text box, does not find a null
LastName, so reports back a null query.

How do I "negate" the null LastName field, asking Access
instead to find all other records that match the values
that ARE entered?
(I've tried wildcards, Or conditions, etc. I've tested
the dialog on a subset of the fields, and if values are
entered it works fine.)

I've spent two days on this, so the solution must either
be very easy or very hard.

Thanks for your help.

John
 
Top