Open a form and apply a filter to the subform

J

Judy

Hello - I'm trying to open a Master Form with subforms, and filter the
subforms based on the value in a menu form. First I tried using a
Macro and opening the form with a where condition applied to the
subform. Then I tried to apply a filter to the subform. When I apply
the filter the subform opens by itself, but will not open correctly in
the main form. Any suggestions about how to accomlish this would be
greatly appreciated.

Judy
 
M

Marshall Barton

Judy said:
Hello - I'm trying to open a Master Form with subforms, and filter the
subforms based on the value in a menu form. First I tried using a
Macro and opening the form with a where condition applied to the
subform. Then I tried to apply a filter to the subform. When I apply
the filter the subform opens by itself, but will not open correctly in
the main form. Any suggestions about how to accomlish this would be
greatly appreciated.


The OpenForm method does not apply to subforms so the
WhereCondition argument is out of the question.
Unfortunately, setting the Filter property in a
mainform/subform arrangement has a major bug in that setting
one erases the other.

The old reliable way to do what you want is to create and
(re)assign the form's and/or subform's RecordSource SQL
statement. When first opening the main form, this should be
done in the (sub)form's Open event.
 

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