Filter on multiple fields

  • Thread starter Thread starter AccessIng
  • Start date Start date
A

AccessIng

Hello all,
How can I filter a form on multiple fields in the form?

I have developed a form that accepts user input in 4 different fields.
Now I want to search the underlying table based on criteria in all o
the 4 fields. I would like to do this search on the form and not in
specific query.

Thanks and kind regards,
AccessIn
 
I'm trying to do exactly the same thing (sorry AccessIng), and so far
have gone about it by making a form that has a line of data based on a
query that simply extracts ALL the information from its underlying
tables. The data shown is limited by the query criteria so that it
matches a user selection in a list box in the header of the form, so
for example :

Model : Ford T

In the header returns :

FordT Black 1000cc
FortT Purple 2000cc
FordT Yellow 1500cc

In the form details section (the line repeats automatically to show
all the records that match the listbox criteria).

The header also has a 'search' button that reruns the query - but it
doesn't do anything unless I physically highlight the contents of the
listbox (tried <listboxname>.setfocus but that doesn't make the button
work either).

Even if I do get this working - am I going about it the right way ?
As with AccessIng's question, I want to specify several search
criteria and have the list show the results of the search. Any ideas
?

Thanks,

Blewyn
 
Hello all,
How can I filter a form on multiple fields in the form?

I have developed a form that accepts user input in 4 different fields.
Now I want to search the underlying table based on criteria in all of
the 4 fields. I would like to do this search on the form and not in a
specific query.

There are several ways one can do this. One is "Filter by Form" - open
the Form, and select Records... Filter... Filter by Form from the
menu. You will get a form with blank controls; you can select values
from one, two, four or all of them and click the Filter icon.

Or, you can use a Parameter Query - have four *unbound* controls on
this form or on a separate one; your query criteria would be

=[Forms]![NameOfForm]![NameOfControl]

for the four fields using the four controls. This can be simple or
more elaborate; if you use for instance

=[Forms]![NameOfForm]![NameOfControl] OR
[Forms]![NameOfForm]![NameOfControl] IS NULL

as a criterion, then any control left blank will retrieve all records
for that field.
 
Hello again,
Thanks for the help John. I think this will be enough to solve m
problems.

AccessIn
 
I'm trying to do the same thing. I'm a newbie, and trying to lear
Access, VBA, etc, so any help would be appreciated!!

I am using Access 2000, and have a form with 2 combo boxes. I wan
what is selected from the first combo box to drive what is in th
second combo box. What then is selected from the second combo box
drives what information is opened in a different form. So far, I hav
the later part worked out. I am just having problems figuring out ho
to make what is selected in the first combo box drive what is availabl
in the second.

Let me know if you need any more information!! Thanks!

Sarah W
NGI
 
dubs70 said:
I'm trying to do the same thing. I'm a newbie, and trying to learn
Access, VBA, etc, so any help would be appreciated!!

I am using Access 2000, and have a form with 2 combo boxes. I want
what is selected from the first combo box to drive what is in the
second combo box. What then is selected from the second combo box,
drives what information is opened in a different form. So far, I have
the later part worked out. I am just having problems figuring out how
to make what is selected in the first combo box drive what is available
in the second.

Let me know if you need any more information!! Thanks!

Sarah W
NGIT

I think you need to make a query that extracts all the data fields
from the underlying table, but uses the criteria (as already shown in
a previous post on this thread) =Forms!YourForm!NameOf1stComboBox for
the field that you're using in the combobox. You then set the query
to be the control source for your second combobox. I think.

Cheers,

Blewyn
 
Back
Top