dsum

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to display on an order form for each customer, a running total of
their spend and total days booked. The way I have tried to do it is to put a
text field on the form and in the control inserted the command
dsum=("cost_of_course",""orders","Customer_order_id=form.Customer_order_id")
where I thought the form.Customer_order_id would be the id displayed in the
box Customer_order_id on the form. It does not work! If I replace the
form.Customer_order_id with an actual value, it works for just that customer.
The display however is just numbers and loses the currrency formatting. Am
I approaching this the wrong way? Can anyone please suggest what I am doing
wrong, or an alternative method to sum the totals and get correct formatting?
 
Concatenate the value of the text box on the form into the 3rd argument of
DSum(), i.e.:

=DSum("cost_of_course", "orders",
"Customer_order_id = " & [Customer_order_id])
 
Thanks for this. Is there any way I can preserve the formatting i.e if I am
summing currency and the total = £33,440.00, how can I get this to display
correctly.
 
Thanks for this. Is there anyway I can get the totals to display in the
correct format eg if the sum =£33,440.00, how can I display the total like
this.
 
Thanks for this. Is there anyway I can preserve the formatting in the text
box eg if sum =£33,440.00 how can display it like this?
 
If this expression goes into the Control Source of a text box, just set the
Format property of the text box to:
Currency

If it's for a MsgBox, use the Format() function, i.e.:
=Format(DSum(...), "Currency")
 
Thank you.

Allen Browne said:
If this expression goes into the Control Source of a text box, just set the
Format property of the text box to:
Currency

If it's for a MsgBox, use the Format() function, i.e.:
=Format(DSum(...), "Currency")
 
Back
Top