Share via

Calculate Totals in a Subform Footer

Anonymous
2011-01-13T21:48:20+00:00

In a subform in an order form I have a continuous form that has the item and quantity order fields, then a lookup for the price and then an unbound control to calculate the total cost for that item. In the subform footer I want to total the quantity and the total cost but am getting error messages. The control source for the unbound control for the quantity is =Sum([Quantity]). The control source for the total cost is =Sum([QuantitySent]*[TTotalCostOfDrug]). What am I missing? Thank you for your assistance.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

15 answers

Sort by: Most helpful
  1. Anonymous
    2011-01-14T16:57:07+00:00

    Thank you for your feedback. To calculate the cost of the total order, in an unbound control in the subform footer, I have =Sum([QuantitySent]*[TDrugCost]). TDrugCost is the name of an unbound control that looks up the price of the drug in a table.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2011-01-14T15:14:15+00:00

    The name of the bound control in the detail section in the subform is TQuantityOrdered. In the subform footer the data control source of the unbound control is =Sum([TQuantityOrdered]). The result is an error.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-01-14T14:03:04+00:00

    I understand, and yes, it can be done, but you have to use the expression from the QuantityOrdered text box in the Sum.

    If you are having trouble with that, post back with the expression in QuantityOrdered and I'll try to sort it out for you.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2011-01-14T13:56:15+00:00

    Thank you for your response. So is there a way to total the quantity in a subform footer? The name of the control source in the detailed section of the form is QuantityOrdered. In the unbound control in the form footer I want to total the QuantityOrdered. Using =sum([QuantityOrdered]) results in an error message. What are the options to total this number?

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2011-01-13T22:28:17+00:00

    The aggregate dubctions can only operate on recird source fields.  They kbow nothing about controls on a form.

    That means that you have to use the expression that calculated the value for TTotalCostOfDrug.  Possibly something like  =Sum(QuantitySent * (price * markup + tax))

    Was this answer helpful?

    0 comments No comments