Changing Criteria

  • Thread starter Thread starter Stewart
  • Start date Start date
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?
 
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
 
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).
 
Back
Top