By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,186 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

showing a query result in employees records

P: 1
OK so here goes.

I have created a table for my "employees details" including "employee number". I have also completed another table which shows orders by "employee number", details of order etc.

I created a query which shows each employee on its own line with a "total number of the orders taken" by the employee rather than a random list showing each individual order. so for example it shows:
Employee ID Total Orders
Employee 1 3
Employee 2 9
Employee 3 7

So now on the "employee details" screen I want to be able to show the total number of orders taken by that individual employee without listing each individual order and date. Every time i try it in a combo box it keeps showing every employees totals in a list rather than just that employee.
so for "employee 1" it shows:
3
9
7
instead of just 3,

How can i make the combo box only show the total for that employee?
Mar 20 '08 #1
Share this Question
Share on Google+
1 Reply


Expert Mod 2.5K+
P: 2,545
...so for "employee 1" it shows:
3
9
7
instead of just 3,

How can i make the combo box only show the total for that employee?
Hi. Seems like you are missing a join between the employees table and your employee order count query - the join would normally be on employee ID or reference number. Without the join you get what is known as the Cartesian product of the rows of the table with the rows of the query - which will indeed show all totals for every member of staff. Could you check this, and post the SQL of the recordsource query for your combo if you are unable to resolve it? It would also be useful to know what the primary key of your employee table is. You will need to include this field in the order count query as well, so you can join the query back to the relevant employee.

-Stewart
Mar 20 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.