OnCalcFields 
Author Message
 OnCalcFields

Quote:
>Hallo,
>i am a new user of Delphi3 ( of delphi anyway). My simple problem is,
>how can i define a field that gives me the result of an
multiplication.
>the database has 'editfield1', 'editfield2', and 'fieldsolution' as
not
>a part of the database.
>My solution is:
>procedure field1change(sender: Tobject);
>       field1:= strtoint(editfield1.text); {line2}
>       field2:=strtoint(editfield2.text);
>       fieldsolution.text:= inttostr(field1*field2);
>end;
>it runs but the errorcode remarks in line2 that '"' is not a integer.
>Could someone gives me a complete solution of an example that runs

fine.

Quote:
>Thanks a lot
>Dieter Kirchner from Germany

here what you have to do:

1)   i used demo table came with delphi3
      right click on ttable on form and select add fields, right click
again to get fields list...
next select add new fields and give it a name (table1Profit in my
example)
goto event of ttable and double click on OnCalcFields to add your
logic

but there is no event 'onCalcFields'

2) you can find help in delphi3.hlp looking for oncalsfield ....

good luck

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
  Grids, DBGrids, Db, DBTables;    

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Table1CalcFields(DataSet: TDataSet);
begin
  Table1Profit.value := Table1ListPrice.value - Table1Cost.value;

...there is no method 'value'.
end;

end.

Thanks
Dieter from Germany



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. oncalcfield event

2. I have a problem on onCalcFields :-(

3. OnCalcFields event for a TQuery

4. Why is OnCalcFields event being generated when...

5. OnCalcField Bug?

6. OnCalcField

7. OnCalcFields - Previous record data

8. TTable.OnCalcFields event

9. OnCalcField-Event-Handler

10. Help with OnCalcFields

11. how constuct oncalcfields ?

12. TTable.OnCalcFields & TDataModule

 

 
Powered by phpBB® Forum Software