Problem with totals on main form from child subform

slharman1

Member
Local time
Today, 10:53
Joined
Mar 8, 2021
Messages
483
I have a main form with a sub form on it. and a subform on that one as well.

The subform's subform has accessories and has these fields: qty, price, exprice.
With exprice being a calculated field of price x qty.
I have a total on the header of this form with this =Sum([ExPrice]) in it's header, all works fine.

Then on it's parent I have these fields: qty, price, accesstotal, exprice, and linetot
With accesstotal being: =[SfrmQuoteAcc].[Form]![txtAccessTotal] This works
And exprice being: =IIf(IsNull([AccessPrice]),[Price],[Price]+[AccessPrice]) This works
and linetot being: =([ExPrice]*[Qty]) This also works

The problem comes in when I try to sum the linetot on the header of the form: =Sum([LineTot]) This produces the error: #Error.

What have I got wrong.

Thanks
 
try instead
Sum([ExPrice]*[Qty])
 
try instead
Sum([ExPrice]*[Qty])
Tried that too - should it work that way?
I am using the builder so I know it is not a typing error.
I am stumped.
 
Last edited:
See if this helps.
It is unclear to me which form or subform you want to put this summation
 
See if this helps.
It is unclear to me which form or subform you want to put this summation
Yes I found that, but o am actually trying to show the total from the form on the same form in the header. Just not working for some reason.
 
Ok, Here is my DB, when you open click on quotes and look for the error on the top left of the order details subform.
This one has me stumped.
 

Attachments

Ok, Here is my DB, when you open click on quotes and look for the error on the top left of the order details subform.
This one has me stumped.
Am I looking at the correct form? I don't see the error.

1635694018870.png
 
If you cannot figure it out the alternate it so do it with a dsum or vba. Sometimes that is simpler for me with these nested forms.
 
If you cannot figure it out the alternate it so do it with a dsum or vba. Sometimes that is simpler for me with these nested forms.
Yes sir, but the damn column of numbers and the sum total field are on the same form. That’s what’s got me stumped.
 

Users who are viewing this thread

Back
Top Bottom