Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

TOTAL FOR A QTY & A CURRECY FIELD IN A SUBFORM

I have a subform within my main form. On the subform I have to fields that I wish to show totals for, a Qty field and a Subtotal(currency)field.  I also needs these results to show on a report.  
0
DWB
Asked:
DWB
1 Solution
 
BigJCommented:
Say you have a subform of orders for a customer. To calculate the order subtotal, you add a text box to the form footer of the subform and specify an expression in the ControlSource property box for the text box. The expression uses the Sum function. For example, the following expression calculates the total amount for all the products in the Orders form: =Sum([Quantity]*[UnitPrice])

Place the expression that calculates the subtotal in the FORM FOOTER of the subform. The form footer isn't displayed in datasheet view - that's OK.

To display the order subtotal on the main form, create a text box on the main form that uses an expression to refer to the control on the subform that contains the calculated value. For example, you could specify the following expression in the ControlSource property box of the text box on the main form:

=[frmSubForm_name].[Form]![OrderSubTotal_field]

Note: If you want to use the value from a calculated control when computing a total, you can't use the name of the control in the Sum function. For example, if you had a control that calculated quantity * unit price, you'd still have to specify the full syntax =Sum([Quantity]*[UnitPrice]) in the expression.
0
 
DWBAuthor Commented:
Cheers, your the greatess
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now