Filter the main form based on a subform filter

Discussion in 'Microsoft Access' started by bjc3@spinfinder.com, Oct 14, 2006.

  1. Guest

    I have 2 tables. One master, one child using Access 2003 (PC)

    Have 2 forms. The main form is continuous while the sub is datasheet.

    I can filter on the main form and the subform filters with it. No
    problem.

    My goal is to be able to filter on the subform and have the main form
    filtered with it. Thought it would be simple but I for a week solid I
    have not been able to solve this on my own. I have review a zillion
    websites and still can't find a solution.

    Any help is appreciated. Thanks in advance!
     
    , Oct 14, 2006
    #1
    1. Advertisements

  2. John Vinson Guest

    On 13 Oct 2006 16:42:53 -0700, wrote:

    >I have 2 tables. One master, one child using Access 2003 (PC)
    >
    >Have 2 forms. The main form is continuous while the sub is datasheet.
    >
    >I can filter on the main form and the subform filters with it. No
    >problem.
    >
    >My goal is to be able to filter on the subform and have the main form
    >filtered with it. Thought it would be simple but I for a week solid I
    >have not been able to solve this on my own. I have review a zillion
    >websites and still can't find a solution.
    >
    >Any help is appreciated. Thanks in advance!


    This is difficult *because* of the Subform structure. The subform is
    in essence already filtered, to that subset of the records which are
    related to the mainform's record; so you don't have the entire table
    available to search.

    This could be done by dynamically changing the recordsource of the
    subform, or (probably better) by using VBA code on some unbound
    controls on the subform; the code would open a Recordset based on a
    query joining the two tables and search it. This will be dependent on
    your actual table structure, and not particularly easy!

    John W. Vinson[MVP]
     
    John Vinson, Oct 14, 2006
    #2
    1. Advertisements

  3. Neil Guest

    >>I have review a zillion websites and still can't find a solution<<

    Me as well!

    If you find a solution, please post it here.

    Neil
     
    Neil, Oct 17, 2006
    #3
  4. John Vinson Guest

    On Tue, 17 Oct 2006 14:13:50 +0100, "Neil" <sherbaal@ yahoo.com>
    wrote:

    >>>I have review a zillion websites and still can't find a solution<<

    >
    >Me as well!
    >
    >If you find a solution, please post it here.
    >
    >Neil
    >


    To repeat:

    This is difficult *because* of the Subform structure. The subform is
    in essence ALREADY filtered, to that subset of the records which are
    related to the mainform's record; so you don't have the entire table
    available to search.

    This could be done by dynamically changing the recordsource of the
    subform, or (probably better) by using VBA code on some unbound
    controls on the subform; the code would open a Recordset based on a
    query joining the two tables and search it. This will be dependent on
    your actual table structure, and not particularly easy!

    John W. Vinson[MVP]
     
    John Vinson, Oct 17, 2006
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Spidey3721
    Replies:
    1
    Views:
    362
  2. Guest

    Enable control on main form based on subform

    Guest, Jun 22, 2005, in forum: Microsoft Access
    Replies:
    2
    Views:
    277
    Guest
    Jun 23, 2005
  3. Guest
    Replies:
    2
    Views:
    191
    Guest
    Jul 27, 2005
  4. Guest
    Replies:
    0
    Views:
    210
    Guest
    Feb 6, 2006
  5. Replies:
    0
    Views:
    631
Loading...

Share This Page