Filtering Multiple Instances of Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 4 instances of the same subform stored in tabs on a main form. I want
to be able to set different filters to each of these instances. I was hoping
that I could set these filters by clicking on each tab, but this does not
seem to work. Any suggestions?
 
Each subform control will have a different name (even if they have the same
SourceObject.) You can refer to them by name, e.g.:
Me.[Sub1].Form.Filter = "Inactive =False"
Me.[Sub1].FilterOn = True

You could run into some Access bugs if you try to set the filter of the main
form as well:
http://allenbrowne.com/bug-02.html
 
Thanks Allen, it worked. Not only that, but I found you could also change
things like combo box rowsources for each instance.

Can I also say how much I appreciate having such an Access wiz in my own
timezone (well...3 hours off my own timezone!)

Thanks for all your help.

Cheers,
Murp
--
Yo Yo Ma.


Allen Browne said:
Each subform control will have a different name (even if they have the same
SourceObject.) You can refer to them by name, e.g.:
Me.[Sub1].Form.Filter = "Inactive =False"
Me.[Sub1].FilterOn = True

You could run into some Access bugs if you try to set the filter of the main
form as well:
http://allenbrowne.com/bug-02.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Murp said:
I have 4 instances of the same subform stored in tabs on a main form. I
want
to be able to set different filters to each of these instances. I was
hoping
that I could set these filters by clicking on each tab, but this does not
seem to work. Any suggestions?
 
Back
Top