By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,135 Members | 1,729 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,135 IT Pros & Developers. It's quick & easy.

DSum one field for Default Value of another

P: 35
Hello,
I had asked this before but the thread was closed for other reasons.

I have two Numeric fields in my Form, MCRef and MCTot.
Actually MCtot is the sum of all MCRef 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

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

I have checked and set format of the TextBx to General Number .

Can someone please help ?
Nov 24 '06 #1
Share this Question
Share on Google+
2 Replies


NeoPa
Expert Mod 15k+
P: 31,660
Somehow it doesn't up in the record when you load the Last record for a Cust_ID

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.
Can we take this (when you load the Last record for a Cust_ID) to mean that you are going to the New Record slot rather than the actual last record?
If so, then it makes some sense.
You are doing a DSum() in the Source using a non-existent value. [Cust_ID] would not be set at this stage (I think), even if the control (MCTot) on the form has a value. If it does, try using that in your DSum() code instead.
Nov 24 '06 #2

P: 35
Can we take this (when you load the Last record for a Cust_ID) to mean that you are going to the New Record slot rather than the actual last record?
If so, then it makes some sense.
You are doing a DSum() in the Source using a non-existent value. [Cust_ID] would not be set at this stage (I think), even if the control (MCTot) on the form has a value. If it does, try using that in your DSum() code instead.
Many thanks for your reply.

Is there a place I can Upload or E mail the database so you can see what I try to do.
Nov 24 '06 #3

Post your reply

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