Question : Probl;em with Totals in Subform/Main From in Access 2007

I have a subform, which can have multiple rows  for Providers.  In the provider rows there is a field called "Originalbill".  I want to sum of OriginalBill and place it on the Main Form.  I have added in the footer of the Subform :   =sum[OriginalBill] and then reference that text box on the main form.  THe problem I am having is that when I have more than one provider row on the subform, the total on main form only shows one of the rows totals?   It does not sum all of the rows ?

Any help?

Answer : Probl;em with Totals in Subform/Main From in Access 2007

=sum[OriginalBill]
will sum the selected record. Instead use:
=DSum ("OriginalBill", "TheNameOfTheTable")
If you only want to sum some of the records in the table, use:
=DSum ("OriginalBill", "TheNameOfTheTable", AFilter)
AFilter should be just like a form filter like
"FieldName = " & ControlNameOnTheForm
Random Solutions  
 
programming4us programming4us