Problem with totals on main form from child subform (1 Viewer)

slharman1

Member
Local time
Today, 17:50
Joined
Mar 8, 2021
Messages
467
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
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:50
Joined
May 21, 2018
Messages
8,463
try instead
Sum([ExPrice]*[Qty])
 

slharman1

Member
Local time
Today, 17:50
Joined
Mar 8, 2021
Messages
467
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:

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:50
Joined
May 21, 2018
Messages
8,463
See if this helps.
It is unclear to me which form or subform you want to put this summation
 

slharman1

Member
Local time
Today, 17:50
Joined
Mar 8, 2021
Messages
467
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.
 

slharman1

Member
Local time
Today, 17:50
Joined
Mar 8, 2021
Messages
467
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

  • DB_be.accdb
    3.4 MB · Views: 404
  • DB.accdb
    6.3 MB · Views: 420

theDBguy

I’m here to help
Staff member
Local time
Today, 15:50
Joined
Oct 29, 2018
Messages
21,358
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
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 18:50
Joined
May 21, 2018
Messages
8,463
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.
 

slharman1

Member
Local time
Today, 17:50
Joined
Mar 8, 2021
Messages
467
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

Top Bottom