We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Base Calculation - sum of subtotals question [closed]

asked 2016-12-24 17:54:15 +0200

DougKMiles gravatar image

updated 2021-05-23 11:36:41 +0200

Alex Kemp gravatar image

I'm trying to create a one-to-many database to track option trading covered calls. The set up is very similar to an invoice. The many records have simple calculations that yield subtotals for each line in a sub-form, all linked to a unique master record, the specific Trade ID.

I've been able to set up the sub-total calculations records for each Trade that work correctly, and I've been able to create a query that produces a sum of subtotals linked to each trade ID. But I cannot get that sum to work correctly in the form. It will show the correct sum for the first Trade ID, but then will not update when moving to the next master record. It stays on the sum for the first master record.

After a day of trying to find the solution, record refreshing, changing linked fields, etc., I've hit the wall.

If anyone has any thoughts, potential solutions, or recommended tutorials to help solve this, I would be most grateful.

Thanks! DM

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-08-07 03:23:43.749329

1 Answer

Sort by » oldest newest most voted

answered 2016-12-24 20:44:36 +0200

Ratslinger gravatar image

It's really just a matter of proper linking. Attached is a sample demonstrating this. In Form1, the top grid is the main form and retrieves the company. The grid under is is on a subform linked to the company selected. It shows the products carried by the company. In a subsubform for the Total, is an SQL statement selecting the total minimum quantity for the products grid. It is linked to the Products table.

When you select a different company, its' products appear on the grid below it and the total min quantity is displayed is the box below it.

Sample: TableTotals.odb

edit flag offensive delete link more


THANK YOU so much for your help.

It took a little bit of trial and error, but I finally got it!

Santa Claus brought me a solution!

DougKMiles gravatar imageDougKMiles ( 2016-12-24 23:15:24 +0200 )edit

You're welcome - Peace on Earth!

Ratslinger gravatar imageRatslinger ( 2016-12-24 23:36:43 +0200 )edit

Question Tools

1 follower


Asked: 2016-12-24 17:54:15 +0200

Seen: 237 times

Last updated: Dec 24 '16