Filter on subform?

A

Alma

I need to do this: A filter within a Subform that is on a Form.

Me![Subform].Form![IDClient].Filter = "[IDClient] = " & Me![CboClient]

And does not work.
Do you know anyway to do it?

thank you
 
A

Allen Browne

The filter applies to the Form, not to the text box, so try:
Me![Subform].Form.Filter = "[IDClient] = " & Me![CboClient]
Me![Subform].Form.FilterOn = True

Please note that if you also apply a filter to the main form, Access is
likely to get very confused when you start removing the filters again. There
are several bugs here where it does not work correctly. Microsoft knows
about the problems, but for nine years they have releasing new versions with
the same bugs instead of fixing them. Details of these problems in:
Incorrect filtering of forms and reports
at:
http://members.iinet.net.au/~allenbrowne/bug-02.html
 
Top