Re: Totals

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Fri, 1 Oct 2004 14:59:15 -0400
Message-ID: <gKSdnUAW3u6wNMDcRVn-hg_at_comcast.com>


"Iceman" <econstantine_at_fattal.com.lb> wrote in message news:92c03dc2.0410010717.3e54e0b7_at_posting.google.com...
| Hi all,
|
| I got a Data Block (A) and another one as a detail (B) joined with a
| master detail relationship on a Form. Also I got another Data Block
| (C) joined in a master details relationship with (B) in a way (B) is
| the master of (C).
|
| Let's suppose that (C) has Quantity and Price fields
|
| How I can show on my form the Totals, which must be the sum of
| Quantity*Price of all the (C) records related to (A)???
|
| Thanks

to use forms calculated fields, you need to have a block that includes are records that contribute to the total

so, you could add a 2nd block based on table C that is a detail of the block you have based on table A -- but you may need to back the new block on a join of tables B and C so that B's FK to A is exposed and available for the master-detail relationship

another approach is to have post-query trigger on block A just do a 'select (SUM)...' the problem you'll have, though, is keeping the A summation synchronized with C records that have not been written to the database... that might require code to automatically post changes made to your current block C, and requery the new block C, or rerun the 'select (SUM)...'

++ mcs Received on Fri Oct 01 2004 - 20:59:15 CEST

Original text of this message