Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable Calculated Fields from changing

Status
Not open for further replies.

Tony1l

Programmer
Dec 21, 2002
30
US
Using a ClientDataSet I've added a calculated field and this works pretty well but only on the last record all previous calculated fields are recalculated and duplicated. I've tried redefining the field using the Fields Editor to InternalCalc but with the same results. How can I insure that values are only evaluated once?

Background:
DBGRID populated from ClientDataSet3 named (dataset3)

Sample Code:
with dataset3 do
Begin
append;
FieldByName('Persistent').AsString:=(var1);
FieldByName('Persistent2').AsString:=(var2);
FieldByName('Calculated').AsString:=(var3);
Post;
end;

procedure Tform1.Dataset3CalcFields(DataSet: TDataSet);
begin
dataset3.FindField('Calculated').AsString:=(Var3);
end;

I've tried to find more information from my reference material & Google but nothing directly addresses this behavior.

Thanks
Tony


 
I solved it... I didn't want to call the OnCalcFields Event for my DataSet3. After Remarking the event it's working beautifully now.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top