Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I filter a main form by applying a filter to a subform?

Status
Not open for further replies.

CSams

Technical User
Jan 26, 2003
5
0
0
DK
Hi all,

I'm working with a main form having up to two nested subforms. I'd like the result of a subform filter to be reflected in the records shown in the main form. What happens now is that the subform is filtered but nothing happens to the main form data despite the link between the forms.
Is there (a simple) way to make Access show only the records in the main form that fulfills the criteria set in the subform?

Many thanx,

Christian
 
Do you have the control source of the mainform in properties pointed to the sub-form?
 
Hi Tango524

Thanks for your response. I'm not sure I competely understand your hint. My main form was meant to show data that is not in the subform so I don't see how I can change the record source of the main form.

br
Christian
 
I am sorry if I confused you. I think I confused myself. I meant the control source on the subform should be pointing back to the main form. I am not sure what your filter is for the records coming down to the sub form from the main form, but you can do calculations in the control source. That is the simplist solution I know, unless someone else can give you more ideas.
 
I have a similar set up.

I have one query (#1) that generates the subform. That query is in the query that generates the master form (#2).

The source tables are linked.

In query #2 the source table is linked to query #1 with a join that shows only records from query #2 that match records from query #1.

If criteria are selected from #1 - the results for #2 are limited by that. If no criteria are selected from #1 then query #2 is not limited.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top