Summing One field for Default Value of another

valley

Registered User.
Local time
Today, 18:23
Joined
Nov 17, 2006
Messages
34
I have two Numeric fields in my Table, MCRefill and MCTot.
Actually MCtot is the sum of all MCRefill for a given Cust_ID

I have the following expression in the Default value of MCtot in my form showing both the fields

DSum("[MCRef]","Miracle_Cloth_Main","[Cust_ID]='" & [Cust_ID] & "'")

Somehow it doesn't up in the record when you load the Last record for a Cust_ID

Can someone please help ?
 
Hello Valley!

You don't need to save MCTot in tbl, because you can calculati it
always you need it.
Look at "DemoMCtotA2000.mdb"
 

Attachments

Hello Mstef

Many thanks for your reply and example.
I have looked at the example.
What I am trying to do is for a PDA application where
the info is required (when a customer is revisited)
on a form field (without having to open and look at the table)
To keep it simple I try to use only one table and one form
I have
=DSum("[MCRef]","Miracle_Cloth_Main","Cust_ID ='" & [Me].[Cust_ID] & "'")
as the default value for the MCRtot field.
I have values in several records for MCRef but it doesn't appear in the form though it looks like the formula is there as it comes up with#NAME? in New records

Could you please help ?
 

Users who are viewing this thread

Back
Top Bottom