Working With Queries To Interact With Multiple Controls On A Form

  • Thread starter nouveauricheinvestments
  • Start date
N

nouveauricheinvestments

Hi,

I have a query that looks up about 10 fields from a child table and
then 7 fields from 7 related parent tables. I have a subform based on
this query which I am filtering with a combo box which looks up the ID
and value in a parent table called Trade_Specialists. This uses a
Union query to combine the values so I have an 'ALL' option. The
query looks like this:

SELECT ID, Trade_Specialist FROM Trade_Specialists UNION SELECT
0,"ALL" FROM Trade_Specialists ORDER BY Trade_Specialist;

The combo box is the criteria for the foreign key in my child table
(the query which the subform is based off of - I have a button that
requeries the subform when I make a selection from the combo box. The
criteria I am seeing displays the combo box control while there is
another column where the combo box control is displayed as the field
and 0 is displayed 3 rows down.

I have another combo box on my subform (making a total of 2) which
does the exact same thing. I am going to attempt to show you how the
criteria is layed out below here because I think that is where I am
having problems. I have tried rearranging it to no avail thus far.


ManagerID TradeSpecialist_ID MControl TSControl
Row 1 MControl TSControl
Row 2 TSControl 0
Row
3
0

The filter works fine UNTIL I try to view ALL Trade Specialists under
any one manager. It returns all records instead of just the records
associated with that given manager. When I view ALL Managers under
any one trade specialist, it works fine. How do I need to change the
criteria?
 
N

nouveauricheinvestments

Hi,

I have a query that looks up about 10 fields from a child table and
then 7 fields from 7 related parent tables. I have a subform based on
this query which I am filtering with a combo box which looks up the ID
and value in a parent table called Trade_Specialists. This uses a
Union query to combine the values so I have an 'ALL' option. The
query looks like this:

SELECT ID, Trade_Specialist FROM Trade_Specialists UNION SELECT
0,"ALL" FROM Trade_Specialists ORDER BY Trade_Specialist;

The combo box is the criteria for the foreign key in my child table
(the query which the subform is based off of - I have a button that
requeries the subform when I make a selection from the combo box. The
criteria I am seeing displays the combo box control while there is
another column where the combo box control is displayed as the field
and 0 is displayed 3 rows down.

I have another combo box on my subform (making a total of 2) which
does the exact same thing. I am going to attempt to show you how the
criteria is layed out below here because I think that is where I am
having problems. I have tried rearranging it to no avail thus far.

ManagerID TradeSpecialist_ID MControl TSControl
Row 1 MControl TSControl
Row 2 TSControl 0
Row
3
0

The filter works fine UNTIL I try to view ALL Trade Specialists under
any one manager. It returns all records instead of just the records
associated with that given manager. When I view ALL Managers under
any one trade specialist, it works fine. How do I need to change the
criteria?

Nevermind. I think my problem was really understanding how queries
work. I figured it out.
 

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