OnCalcField

OnCalcField

Post by pc » Sun, 31 Dec 1899 09:00:00



Hello

I have written a few lines of code to handle the event of oncalcfield

var
  i : integer;
begin
  i := ProductSQL.FieldByName('TrProdQty').AsInteger;
  Application.messagebox(pchar(i), 'i=',mb_ok);
end;

I want to calculate the total of quantity. I try to look at the value of total.
But the procedure seems nothing to happen.

Could anyone know why?

Thanks

pc

 
 
 

OnCalcField

Post by Artem Kornilo » Sun, 31 Dec 1899 09:00:00


You have proposed very unusual way to calculate total ;)
property A.OnCalcFields(DataSet: TDataSet);
begin
    ProductSQL.Close;
    ProductSQL.Open;
    Application.messagebox(ProductSQL.FieldByName('TrProdQty').AsString,
'Total',mb_ok);
end;

 
 
 

1. I have a problem on onCalcFields :-(

Hi, everyone~!
I am new in programing with Delphi coding.
I need your help.

I make sql statement with table A and B.
The result displayed on a DBGrid.

And I want to make sum -calculated field - like this:

--------------------------------------------------
      A.amount       B.price        Sum (calculated field)
1.        2                  10 $              20 $
2.        1                  15 $              35 $
3.        1                  20 $              55 $
                      .......
--------------------------------------------------

I don't know how to display 'Sum' field on a DBGrid and on what event.

Please help me..

Thanks~!

2. quick question

3. OnCalcFields Problem

4. banners

5. Q: Reading memos inside OnCalcFields (Delphi 1.0)

6. Disk-caching Controller for SQL Server 7.0

7. TTable.OnCalcFields & TDataModule

8. HELP! Visual Basic and SQL Server

9. OnCalcFields Problem

10. tdatset.OnCalcFields event ?

11. OnCalcFields

12. OnCalcFields vs OnGetText?

13. oncalcfield event