Dsum result keeps changing

izen

Registered User.
Local time
Today, 19:33
Joined
Apr 2, 2009
Messages
50
I am using Dsum funtion to calculate total product cost
Dsum("[Filed Name]","Table Name").
But the sum result keeps changing when i click to anoather colunm. sometime I clear all the number the sum result should zero (0) but sometime when i click on some records Dsum still have number in there.

why it happens like this ?

thank you
 
Where are you using the DSum() function? On a form? in a query? Could you provide some more details?
 
thanks jzwp22
I am using Dsum on the form that gets the data from the user input.
there are product ID, ProductName, UnitCost, StockLevel (table product)
and I use those fields to be fileds in query which is the query stocktake in order to calculate StockLevel*UnitCost. in this query I create one more filed which is StockCost (tockLevel*UnitCost). In the from I add txt lebel (unbound) to calculate Dsum from query stocktake.

basicly I put dsum in the form which cal from query.

the problem is when i delete or edit unitcost or stocklevel and i click calculate Dsum the result sometime update in some records. I did put reQuery and refresh in the calculate button.

thanks
 
I'm still confused. You have the following table

Product
-productID
-productname
-unitcost
-stocklevel

You should be able to just have an expression to calculate stocklevel*unit cost. You would not need the DSum, but if you are using the DSum() on the product table and change either the unitcost or stocklevel, the DSum() value will change.

It sounds like you are tracking inventory of products. You might want to take a look at this site that provides an example of a table structure that can be used for that purpose.
 

Users who are viewing this thread

Back
Top Bottom