Filter on subform

G

Guest

Hi

I want to apply a filter on a subform, but the name of the subform is a
string as i have a few subforms that i need to change the information on
using the apply filter. I have tried the following and prob realise there is
somethin really similar that will work but i can't get it to work.

Forms.Item("Frm_View Detailed").Form(formname).Filter =

Thanks for any responce in advance

Cheers

Danny
 
A

Allen Browne

Try something like this:
Forms![MyMain]![MySub].Form.Filter = "Surname = ""Smith"""

If you need to use string variables for the names:
strMain= "MyMain"
strSub = "MySub"
Forms(strMain).Controls(strSub).Form.Filter = ...
 

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