Hi all,
I have a problem with the event manager of datasource.
I write :
procedure tfrmUserRec (Sender: TObject; Field: TField);
begin
if field =nil then statbar.text:=inttostr( recno)
else
begin
sum:=sum+field.curvalue; //calculated three times
showmessage(field.fieldname); //showed three times;
end;
end;
the record contains fields (NTIERS, DATE, NPIECE, AMOUNT )
FIRST TIME AMOUNT IS SHOWED THAT' S OK BECAUSE IT IS THE FIELD WE CHANGED
SECOND TIME NTIERS ?????????
THIRD TIME NTIERS ?????????
ANY IDEA ? ( THIS CONCERNS FREE PASCAL OR LAZARURUS );
tdatasource
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: tdatasource
The field NTIERS is a foreign key and never be changed manualy.
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: tdatasource
I am sorry,
in that case it should be
in that case it should be
Code: Select all
procedure tfrmUserRec (Sender: TObject; Field: TField);
begin
if field =nil then statbar.text:=inttostr( recno)
else if Field.FieldName = 'AMOUNT' then
begin
sum:=sum+field.curvalue; //calculated three times
showmessage(field.fieldname); //showed three times;
end;
end;