Problem With Filter by Form

J

John Lane

When I do a Filter by Form on a subform in Access 97, it
retrieves the correct records from the underlying table,
however all the main form records show. Why? How do I fix
it? Also, when I look at the Help file it has the inane
hint: "The filter behaved correctly. When you create a
filter on a subform, it only applies to the subform. To
filter the records on the main form, click the main form,
and then create the filter." What the heck does that mean?
Create a filter where?
 
J

John Lane

Yeah, I was afraid of that.
-----Original Message-----


It means...

When you create a filter on the subform you are in affect saying "When I look at main
records, only show subform records matching this
filter". It places no restriction
on which main records you will see.

If what you want is "Show me only the main records that have certain types of
subrecords" then this cannot be done with a standard
filter. You would have to apply
a filter in code that looked something like. . .

[ID] IN(SELECT [ID] FROM YourSubTable WHERE ...)

You would have to supply the appropriate criteria after the "WHERE".


.
 

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