Combine Duplicate and Total

Meking

New member
Local time
Yesterday, 21:07
Joined
Aug 10, 2007
Messages
8
I need a report to print out from a form that combines like Items and then totals them. The report will not have the department field listed....

Here's an example:

Form:

Department---Product#---Type----Qty-Cost-- Total

Accounting---------i123 ----pen---- 2-- 1.00-- 2.00
Management--------a987 ----paper-- 3 --1.00-- 3.00
HouseKeeping-------i123 ----pen ----1 --1.00 --1.00
Shiping/Receiving---a987---- paper-- 4 --1.00 --4.00


What I need on report:
Product#---Type----Qty-Cost-- Total
i123-------- pen ----3 --1.00 --3.00
a987------- paper --7 --1.00 --7.00


Please help......
 
Are you trying to do this in a query or a report?

Since you are asking in the query section, here's how to do it in a query.

SELECT Product, Type, Sum(Qty) AS SumOfQty, Cost, [SumOfQty]*[Cost] AS Total
FROM tblData
GROUP BY Product, Type, Cost;
 
Reports and forms are separate objects. Create a report the sums to the level you want. You can add a button to the form to open the report. You can modify the OpenReport code so that it provides a where clause that will constrain it to the same set of data as is showing on the form.
 
Sorry the reason why i posted this in the query section is because I am basing both the form and report off the same query.
 

Users who are viewing this thread

Back
Top Bottom