OnCalcfields forwarding not working lazarus / 16-Databases ---------------------------------------------------------------------- mangakissa · 2015-02-03 15:52 Strange. I get data, but the OnCalcfields wil not work. The debugger wil not going to my breakpoint in  procedure TAdopties.DoCalcFields(dataset : TDataset); . so I see nothing happen on screen. Code: [Select]var   FLookups            : TDMLookups;  property Datamodule   : TDMContacten read GetModule;  function TAdopties.Init(Datasource, datasource2: TDatasource): boolean; begin   fAdoptieDataset   := Datamodule.SQLAdopties;   fCurrentdataset   := Datamodule.SQLAdopties;   if uGebruiker.LoggedOk then   begin     if fCurrentdataset <> nil then     begin       datamodule.SQLAdopties.AutoCalcFields := true;       datamodule.SQLAdopties.OnCalcFields   := @DoCalcFields;       result := true;       ..........       fCurrentdataset.Active := true;     end   end else result := false; end; procedure TAdopties.DoCalcFields(dataset : TDataset); begin   if FLookups.L_Banken.Locate('ID',vararrayof([RecordValue('ID').AsInt eger]),[]) then     LblBICcode.caption := FLookups.L_Banken.fieldbyname('dd').AsString   else    LblBICcode.caption := ''; end; ---------------------------------------------------------------------- rvk · 2015-02-03 16:57 Do you actually have some calculated fields in your dataset? The OnCalcFields is only executed if there are calculated fields (not just if you set AutoCalcFields to true, which is default b.t.w.). QuoteAutoCalcFields is by default true, meaning that the values of calculated fields will be computed...(http://lazarus- ccr.sourceforge.net/docs/fcl/db/tdataset.autocalcfields.html) QuoteOnCalcFields is triggered whenever the dataset needs to (re)compute the values of any calculated fields in the dataset. It is called very often, so this event should return as quickly as possible.(http://lazarus- ccr.sourceforge.net/docs/fcl/db/tdataset.oncalcfields.html) ---------------------------------------------------------------------- mangakissa · 2015-02-03 17:46 Nop. I have to use OnAfterScoll event