Link to home
Start Free TrialLog in
Avatar of delphyst
delphyst

asked on

running total ?

well, i want to make a invoice form using master detail relation but i got problem to show total ammount of detail item. Help me please.
Avatar of delphyst
delphyst

ASKER

i'm using
-TTable both for master and detail

delphyst,

use a query for it or make your detail also a master of another detail (=> this one calculates total of detail).

Zif.
ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
See example in Delphi 3\Demos\DB\CtrlGrid\CtrlGrid.dpr
procedure TDM1.CalculateTotals(Sender: TObject; Field: TField);

In short
    Detail.disableControls;  { hide this process from the user }
    Detail.first;
    while not Detail.eof do
    begin
      // calculate Totals
      Detail.next;
    end;
    Detail.first;
    Detail.enableControls;  { restore the display }

If you want only total ammount of detail item
use Detail.RecordCount