Solved Order Totals on a New Order (1 Viewer)

debsamguru

Member
Local time
Today, 15:43
Joined
Oct 24, 2010
Messages
82
That's what I was afraid of! If, instead of calculating it in the subform footer, could I calculate it in the form footer with a DSUM? Would that be a better way of handling this?
 

June7

AWF VIP
Local time
Today, 07:43
Joined
Mar 9, 2014
Messages
5,423
No, it would not. Domain aggregates cause slower performance and if filter is applied to form, the calc will not be correct unless same filter applied in DSum. Did you review my previous post #39?
 

debsamguru

Member
Local time
Today, 15:43
Joined
Oct 24, 2010
Messages
82
Aggregate functions must reference fields, not controls. The field can be calculated in table or query, but not form/report textbox. If calc is just in textbox then have to repeat in the aggregate calc: =Sum(Nz(expression here,0))

Is CostPrice/SalesPrice a field name? Advise not to use punctuation/special characters in naming convention.
There isn't a special char in the field, I was just using that to imply that I used the same calculation for both the CostPrice and the SalesPrice.

Even using the expression in the aggregate calc doesn't work.
Calculated field TotalCostPrice = [QuantityRequired]*[CostPrice] where QuantityRequired and CostPrice are fields on the OrderItemT
Aggregate calc TotalOrderCostPrice = Sum(Nz([QuantityRequired]*[CostPrice],0))
TotalOrderCostPrice still shows as an error.
 

June7

AWF VIP
Local time
Today, 07:43
Joined
Mar 9, 2014
Messages
5,423
Works for me. Perhaps you should start a new thread. Maybe provide db for analysis.
 

debsamguru

Member
Local time
Today, 15:43
Joined
Oct 24, 2010
Messages
82
Thank you all so much. I've finally got it working. I used the same query I had at the beginning, with the same calculations, and now it works!! All the lines are shown exactly as I want them and not scrolling up. I don't know exactly which step I did that made it work but it does not and I'm not going to stress about it!! (At least, not until the next problem!)

Thanks you all for your help. I suspect you'll be hearing from me again as I get deeper into the project. Note to self - never offer to do things for family!!
 

Users who are viewing this thread

Top Bottom