Filter the main form based on a subform filter

B

bjc3

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!
 
J

John Vinson

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]
 
N

Neil

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
 
J

John Vinson

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]
 

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