Help creating DSum formula

Repent

Registered User.
Local time
, 21:36
Joined
Apr 10, 2008
Messages
108
I am trying to create a DSum formula (to use as a control source in a chart) in a query that will look at a particular set of records(based on a product type), and take the value of that record's waste number (a calculated number) and divide that by the value of that record's LF Run number (entered by user).

The table name is: tblProductionNumbers
Waste is a calculated field already in the query. Waste: [LF Run]-[LF Produced]
LF Run is a value entered by user
LF Produced is a value entered by the user

So to do that "longhand" I would look at the query, which could contain dozens of records, and find all the records that are for the same product. Let's say that product is called "LL100". I would then sum up the waste numbers for the LL100 product, and then take that total and divide it by the sum of the LL100 product's LF Run numbers to arrive at a figure called "Waste%".

How would I construct this in a DSum formula?
 
Can I even use DSum with two tables? The part number is in tblProductList and the rest of the data is in tblProductionNumbers.
 
Last edited:
I thought it might be easier to provide you a copy of my DB so you can see what I have going on. I'm a noobie so I'm sure that things are not as optimized as they could be.

When you open the DB the main form will open up. On the left side is where the operator enters in their records. The charts on the right side are on a subform and will update themselves based on the info in the records being entered.
There are line charts for "waste%" and "productivity"and on each chart is a "totals box" either in red or green boxes (data from DLookup). There are tabs for current "Weekly, Monthly, Quarterly, Yearly, Operator Waste%, and Operator Productivity" They all currently show the same data as I removed most of the records to trim down the file size.

Currently the figures all reflect "averages" and I want them to now show "actuals". I won't attach the code used to get the averages as you will readily see the code in the properties section. Below are how the numbers are calculated in the form on the left side. I'm just not sure how to get the charts to show actuals as well.

Waste =[LF Run]-[LF Produced]
Waste% =[Waste]/[LF Run]
Productivity =[LF Produced]/33.75 (hours--I will be changing this value soon)

If I can see how to make the actuals show on the weekly tab for waste% and productivity as well as the totals I should be able to duplicate that code onto the other tabs. That is, if it's that straight forward.

I greatly appreciate you taking a look at this for me.
 

Users who are viewing this thread

Back
Top Bottom