Total from Subform

  • Thread starter Dee S via AccessMonster.com
  • Start date
D

Dee S via AccessMonster.com

I need a total to calculate on my main form from numerous entries in a
subform. For example I have a customer with several workorders. Each of
the workorders (listed in the subform) needs to wrap into the customer
total on my main form. I keep getting erros. Help please...
 
L

Larry Tompkins

Hello Dee,

You can Sum your totals in the Sub Form in a hidden Form Footer Section.
Then in the main form just refer to the text box with the total information.

Example:
Sub Form Name = FrmWorkOrderSub
Text Box Name = SumBal (Contains the Sum of the work orders)
Main Form Name = FrmWorkOrderMain

In your main form text box put this formula in:
=IIf(IsError(Forms!FrmWorkOrderMain!FrmWorkOrderSub.Form!SumBal),0,Forms!FrmWorkOrderMain!FrmWorkOrderSub.Form!SumBal)

Hope this helps.
Larry
 
D

Dee S via AccessMonster.com

Thanks Larry,

I'm running into problems though. On my subform, there are a few controls
that dictate the line totals. These controls, along with the totals are
not in the table.
For example, I have a products table which includes productID, size,
quantity and options. I created controls with iif statements to determine
price (because of different options). My line total = the sum of these
controls less discounts.
The line totals in the subform are working but when I try to use the form
footer total, I get errors, or I'm only picking up 1 line in the subform
and not the total.

(I hope this makes sense)
Any suggestions?
 
D

Dee S via AccessMonster.com

Larry,

I worked this form another way and used your formula. Worked beautifully!!!
Thanks so much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top