Filtering a subform

S

Shiva

Hi,

I wonder if it is possible to filter a subform in Access 2002. In other
words, the selection criteria of the filter are defined by the fields of the
subform.

This doesn't seem to work. The only way I can make up to implement this, is
to open a another form that works on the same table as the subform; then the
filter should be applied to this form; next the foreign keys pointing to the
master should be collected and be assigned to the filter of the mainform
using some VBA. This is quite a roundabout way imho, so isn't there an
easier method?

Thanks in advance!
 
R

Rick Brandt

Shiva said:
Hi,

I wonder if it is possible to filter a subform in Access 2002. In
other words, the selection criteria of the filter are defined by the
fields of the subform.

This doesn't seem to work. The only way I can make up to implement
this, is to open a another form that works on the same table as the
subform; then the filter should be applied to this form; next the
foreign keys pointing to the master should be collected and be
assigned to the filter of the mainform using some VBA. This is quite
a roundabout way imho, so isn't there an easier method?

Thanks in advance!

You can using the advanced filter tool. You just have to use a subquery for the
filter.

Example:

Order form with subform LineItems. I want all orders that contain a line-item
with part number 1234-56A. The filter for the main form is...

OrderNum In(SELECT OrderNum FROM LineItems WHERE PartNumber = "1234-56A")
 

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