DevastatioN
Registered User.
- Local time
- Today, 02:25
- Joined
- Nov 21, 2007
- Messages
- 242
Hello,
Let's say I have a master form, which has two One-to-Many continuous subforms. If I wanted to be able to filter the results based on subform values (for example, show all master records which has a subform record equal to 'Product Name', this way I can filter out all 'Companies' that have only the certain product I'm looking for). Usually I would make the query which drives the master form have the parent table, and the child table with an INNER join.
However, what if I wanted to do this for two subforms. I cannot base a query off of two separate one-to-many relationships using INNER joins, because the query doesn't react as it should obviously.
If I only allowed the users to do a search on one subform, or the other subform, I believe I can make two combined queries (Parent and Child Number 1, Parent and Child Number 2) and then change the recordsource based on which subform they chose to search on, and then apply the filter.
But what if they wanted to filter both subforms together. The example I listed above would be some type of company database, which isn't my real life possible example, but it applies just the same.
Overall Example:
tblCompanies has many in tblProducts
tblCompanies has many in tblPaymentOptions
So let's say I have a main form for Companies, one subform that lists all products, and one subform that lists all possible payment options. Combining all three tables in a query doesn't work correctly to be able to base a form off of. What if the user wanted to filter the form for all companies which has Product A, and accepts PaymentOption VISA?
Let's say I have a master form, which has two One-to-Many continuous subforms. If I wanted to be able to filter the results based on subform values (for example, show all master records which has a subform record equal to 'Product Name', this way I can filter out all 'Companies' that have only the certain product I'm looking for). Usually I would make the query which drives the master form have the parent table, and the child table with an INNER join.
However, what if I wanted to do this for two subforms. I cannot base a query off of two separate one-to-many relationships using INNER joins, because the query doesn't react as it should obviously.
If I only allowed the users to do a search on one subform, or the other subform, I believe I can make two combined queries (Parent and Child Number 1, Parent and Child Number 2) and then change the recordsource based on which subform they chose to search on, and then apply the filter.
But what if they wanted to filter both subforms together. The example I listed above would be some type of company database, which isn't my real life possible example, but it applies just the same.
Overall Example:
tblCompanies has many in tblProducts
tblCompanies has many in tblPaymentOptions
So let's say I have a main form for Companies, one subform that lists all products, and one subform that lists all possible payment options. Combining all three tables in a query doesn't work correctly to be able to base a form off of. What if the user wanted to filter the form for all companies which has Product A, and accepts PaymentOption VISA?