Subform filter on the fly

  • Thread starter Thread starter yagfxgeek
  • Start date Start date
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!
 
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
 
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
 
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!
 
Back
Top