Subform filter on the fly

Y

yagfxgeek

I have a subform that I am attempting to set a filter value for.
However access claims that the subform does not have a property or
method called filter. I know its not a misspelled name or anything as
I can execute a refresh on the sub form:

Forms!frm_BUDATA!Contacts.Requery

However, the statement:

Forms!frm_BUDATA!Contacts.Filter = sFilter

Generates an error. Can anyone shed some light on this?

Thanks!
 
D

Dirk Goldgar

yagfxgeek said:
I have a subform that I am attempting to set a filter value for.
However access claims that the subform does not have a property or
method called filter. I know its not a misspelled name or anything as
I can execute a refresh on the sub form:

Forms!frm_BUDATA!Contacts.Requery

However, the statement:

Forms!frm_BUDATA!Contacts.Filter = sFilter

Generates an error. Can anyone shed some light on this?

Thanks!

The subform *control* you are referencing has no such property, but the
form object it is displaying does. Try:

Forms!frm_BUDATA!Contacts.Form.Filter = sFilter
 
D

Dirk Goldgar

Dirk Goldgar said:
The subform *control* you are referencing has no such property, but
the form object it is displaying does. Try:

Forms!frm_BUDATA!Contacts.Form.Filter = sFilter

And don't forget to follow up with

Forms!frm_BUDATA!Contacts.Form.FilterOn = True

More efficient would be

With Forms!frm_BUDATA!Contacts.Form
.Filter = sFilter
.FilterOn = True
End With
 
Y

yagfxgeek

Dirk Goldgar said:
And don't forget to follow up with

Forms!frm_BUDATA!Contacts.Form.FilterOn = True

More efficient would be

With Forms!frm_BUDATA!Contacts.Form
.Filter = sFilter
.FilterOn = True
End With

Thank you SO much!
 

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