TZQuery.OnCalcFields- Why it is executed twice? lazarus / 63-Database ---------------------------------------------------------------------- SunyD · 2017-03-22 17:03 I use TZQuery.OncalcFields, if I call TZQuery.Refresh then OncalcFields executed twice. Do anyone know, why the is executed twice? This is my code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.QuZCalcFields(DataSet: TDataSet);begin  //Saldo is Currency  // QuZSOLL and QuZHABEN are fields of this query  Saldo:=QuZSOLL.AsCurrency-QuZHABEN.AsCurrency+Saldo;   //Only QuZSALDO is CalcField  QuZSALDO.AsCurrency:=Saldo;  //ZBS ist autoinc  Memo1.Lines.Add(TimeToStr(now)+' - #BS: '+QuZ.FieldByName('ZBS').AsString+' - S: '+Format('%.2n', [saldo]));end;  And here is log output after calling QuZ.Refresh; 18:01:08 - #BS: 1 - S: 50,00 18:01:08 - #BS: 2 - S: 550,00 18:01:08 - #BS: 3 - S: 550,00 18:01:08 - #BS: 4 - S: 610,00 18:01:08 - #BS: 5 - S: 640,00 18:01:08 - #BS: 1 - S: 690,00 18:01:08 - #BS: 2 - S: 1.190,00 18:01:08 - #BS: 3 - S: 1.190,00 18:01:08 - #BS: 4 - S: 1.250,00 18:01:08 - #BS: 5 - S: 1.280,00