Changing Criteria

S

Stewart

Is there any way to remove certain criteria from a Select Query? I have a
button my form that brings up a report based on a query, where I have the
criteria as combo boxes on my form, the problem is you MUST enter data for
ALL criteria. Is there a way to only filter the data by one combo box
criteria?
 
J

Jim/Chris

If I get what you are saying you want the ability to select
all of the criteria selected in the combo box. What I do
in my query criteria is
like [Forms]![formname]![ComboBoxName]&"*"

This way to select all records leave the conbo box blank

Jim
 
J

John Vinson

Is there any way to remove certain criteria from a Select Query? I have a
button my form that brings up a report based on a query, where I have the
criteria as combo boxes on my form, the problem is you MUST enter data for
ALL criteria. Is there a way to only filter the data by one combo box
criteria?

One way is to use a criterion of

=Forms!NameOfForm!NameOfCombo OR Forms!NameOfForm!NameOfCombo IS NULL

on each field. If the user doesn't select anything from one combo,
then it will not use that criterion (i.e. if you left all the combos
blank you would see all the records in the table).
 

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

Top