Open a form and apply a filter to the subform

  • Thread starter Thread starter Judy
  • Start date Start date
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
 
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.
 
Back
Top