473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

showing a query result in employees records

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
1 1332
Stewart Ross
2,545 Expert Mod 2GB
...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

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

Similar topics

4
by: sci | last post by:
Could someone help me by answering the questions below? What's a cursor? What's difference between Query and View? Is a RecordSet just part of a table? Can it be part of a query of view? If...
2
by: P B via AccessMonster.com | last post by:
I have a list of 160,000 records with these fields: fname, lname, address, city, state, zip, dob I need to generate a list with all fields where the first initial of lname and the dob are...
0
by: Frnak McKenney | last post by:
One part of a customer project I'm working on involves what seem like fairly straightforward updates to a set of related tables. While I've developed software for a number of years (it only seems...
7
by: serge | last post by:
How can I run a single SP by asking multiple sales question either by using the logical operator AND for all the questions; or using the logical operator OR for all the questions. So it's always...
3
by: auron | last post by:
Hi there, I have a really stupid and banal problem with showing the results of a MySQL query in PHP, preciselly with MySQL count() function that gives to a variable in PHP the result. NOTE:...
3
by: visionstate | last post by:
Hi All, I have used the following article to help me build a query 'on the fly': http://www.fontstuff.com/access/acctut17.htm It's a very useful article and is exactly what I was looking for to...
5
by: Sam | last post by:
Hi, I have one table like : MyTable {field1, field2, startdate, enddate} I want to have the count of field1 between startdate and enddate, and the count of field2 where field2 = 1 between...
1
by: Simon Gare | last post by:
Hi all, having problem with query below SELECT DISTINCT dbo.logon.DRIVER_NO, dbo.booking_form.DriverNo FROM ((dbo.logon RIGHT JOIN dbo.Employees ON dbo.logon.DRIVER_NO =...
7
by: underground | last post by:
I have a problem that I've spent countless hours on and I'm more than certain this is a obviuos issue to an expert but I am still learning. I have a paging script that I have modified to display a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.