Querying from a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I hope someone can help.
I have a small inventory database, and I want to make a form where a user
can specify upto five different criteria to search by. I tried using this in
the Criteria box on the design grid: = forms!SearchForm!category and so on
for each criteria. Problem is if the user decides not to use a field to
search by, the query seems to treat the criteria as ISNULL. I don't know how
to create this to allow zero to five search values.
 
For each category, your criteria needs to look like:
forms!SearchForm!category Or (forms!SearchForm!category Is Null)

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
Thanks Steve, I have tried this but when I run the query, it acts like a
parameter query and asks for user input for each criteria again. this is
killin me. i feel confident this can be done, but I just cant figure how.
 
Dan Robles said:
Thanks Steve, I have tried this but when I run the query, it acts like a
parameter query and asks for user input for each criteria again. this is
killin me. i feel confident this can be done, but I just cant figure how.

How about using "filter by form"?

Keith.
www.keithwilby.com
 
Something is not entered correctly!!

What is the name of your search form?

What are the names of each of the five criteria fields on your search form?

What are the names of the five fields in your query where you enter
criteria?

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
Steve, thanks for your continued help.
My search form is SearchBy. My criteria fields are Asset, Category, Cost,
Building, and Location.

After entering the arguments in the criteria as you recommended, Access
stripped away the OR [Forms]![SearchBy]![FieldName] Is Null for each of these
and added a field at the end of the query design grid that had a similar Is
Null statement in it.

I have a combo box called Condition in front of the Cost criteria that
allows the user to select <, >, or =, to make cost a more flexible field, i
was going to worry about tying both fields to the criteria of the query after
getting the other criteria fields to behave properly.

Dan
 
I am willing to try anything, but I am trying to set this up for a user who
has no knowledge of access and how to apply filters, can you point me in the
right direction for creating a command button that applies the filter?

Dan
 
Dan Robles said:
I am willing to try anything,

Search the help for "filter by form". It's a powerful built-in filter
utility based upon the form with the focus. Dead simple to use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top