Filtering unbound subforms

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

Guest

I have a database that tracks school districts and all of the construction
projects that they are planning.

The main form of my database is basically a "shell" form with an unbound
subform. When a user clicks on a menu option it opens the desired form in
the unbound subform.

This unbound subform will not allow me to open a certain form and then apply
a filter based on information that the user has already entered. When I use
this particular form by itself (not through the subform) everything works
perfectly.

My code to open the form is:

Forms![Switchboard]![Subform].SourceObject = "Projects Per Contract"

Then I want to apply my filter but it keeps telling me that the object does
not support this property or method. Is that because it's an unbound subform?

Any suggestions would be great!

Thanks!
 
Thanks Allen! You're a life-saver! I knew it was something easy, I just
couldn't find it anywhere.

Allen Browne said:
Try:
Forms.[Switchboard].[Subform].Form.Filter = ...

If the ".Form" bit is new, see:
http://allenbrowne.com/casu-04.html

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

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

Suzie Raboin said:
I have a database that tracks school districts and all of the construction
projects that they are planning.

The main form of my database is basically a "shell" form with an unbound
subform. When a user clicks on a menu option it opens the desired form in
the unbound subform.

This unbound subform will not allow me to open a certain form and then
apply
a filter based on information that the user has already entered. When I
use
this particular form by itself (not through the subform) everything works
perfectly.

My code to open the form is:

Forms![Switchboard]![Subform].SourceObject = "Projects Per Contract"

Then I want to apply my filter but it keeps telling me that the object
does
not support this property or method. Is that because it's an unbound
subform?

Any suggestions would be great!

Thanks!
 
Back
Top