Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Location
    New Hampshire Coast
    Posts
    18

    Red face Unanswered: multiple filters on a form

    good Friday folks,

    i'm trying to do something which i think should be pretty simple, but i can't seem to make it work.

    i have a form, it's a data entry form, on which i'd like to be able to filter the records 2 or 3 times.

    for example, the database has records from 2003 and 2004. the first filter would be for selecting the year.

    the next filter would be to filter those records that belong to a particular "rep".

    the next filter would be a particular client.

    so, the problem: how do i do one filter at a time and have the filters build on each other?

    thanks
    myles

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: multiple filters on a form

    Originally posted by MylesEngland
    good Friday folks,

    i'm trying to do something which i think should be pretty simple, but i can't seem to make it work.

    i have a form, it's a data entry form, on which i'd like to be able to filter the records 2 or 3 times.

    for example, the database has records from 2003 and 2004. the first filter would be for selecting the year.

    the next filter would be to filter those records that belong to a particular "rep".

    the next filter would be a particular client.

    so, the problem: how do i do one filter at a time and have the filters build on each other?

    thanks
    myles
    How are you (or should ask) how do you want to stack the filters up? Ordinarily you'd concat filters together with ANDs and ORs ...

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    When you apply "filters" what you're really doing is building the WHERE clause for the underlying query. Within the WHERE clause, you can specify all the criteria you would like by using AND & OR.

    eg:

    SELECT *
    FROM t1
    WHERE (YEAR(t1.date) IN (2003,2004)) AND t1.rep_id = 4 AND t1.client_id = 6

  4. #4
    Join Date
    Mar 2004
    Location
    New Hampshire Coast
    Posts
    18

    Re: multiple filters on a form

    I guess what I had in mind was....

    1 Filter (combo box) to select the year, which would return all records from that year with another combo box to select the rep, which would return all records for that rep.

    So the user would do the filters one at a time.

    Originally posted by M Owen
    How are you (or should ask) how do you want to stack the filters up? Ordinarily you'd concat filters together with ANDs and ORs ...

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Search for "cascading combo boxes"

  6. #6
    Join Date
    Feb 2004
    Location
    CT,USA
    Posts
    250
    How about using a continuous form with a search header. In the search header put check boxes adjacent to your text boxes once filled and checked rebuild filter and requery. This would avoid speed pitfalls of cascading queries. There is some VBA required here, but it's well worth it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •