Question:

In Microsoft Access, how to filter to show all fields if criteria is blank, and =criteria if not blank?

by  |  earlier

0 LIKES UnLike

I made a query that filters based on an criteria entry, but what should i input in the criteria to be able to do this:

if i enter "white" in the parameter field, it will show all records with "white"

if i enter "black" in the parameter field, it will show all records with "black"

but if I leave the parameter field blank, it will show all records, including but not limited to "black" and/or "white"

 Tags:

   Report

3 ANSWERS


  1. If you're creating a parameter query, then

    In the criteria for the colour field, put

    [First Colour:] Or [Second Colour:]

    You will be prompted twice for a parameter value, and you can enter "white", then "black"

    If you just want the records where this field is "black" or "white" then

    put

    "white" Or "black"

    as the criteria  


  2. i dint get ur question properly.. but u have to make use that the name what u given in declaration and parameter shoul be same...

  3. Create two criterion - one for white, one for black

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.