DBLookupCombobox problem when create on the fly and post reccord lazarus / 16-Databases ---------------------------------------------------------------------- rmmm · 2024-08-08 21:32 Hi Everyone here, I have a problem and attachement a simple project to ilustrate it. When i create "on the fly", after post, the  component inactive If i use component from form, all is OK.  Can someone advise, where's my fault? Thanks! 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.FormCreate(Sender: TObject);varSQL1:TSQLQuery;DTS1:TDataSource;begin   with MySQL56Connection1 do begin      HostName:='localhost';     UserName:=''; //'user24';     Password:=''; //'2024';     DataBaseName:='db24';     Connected:=True;  end;   SQLTransaction1.Active:=True;   with SQLQuery1 do begin     SQL.Text:='select * from art';     Open;  end; // { // OPTION I: WORK FINE with SQLQuery2 do begin   SQL.Text:='select * from fam order by fam_nom';   Open;   DBLookupComboBox1.ListSource:=DataSource2;end; // } //{// OPTION II:  "After update and post"  component DBLookupComboBox1 "DISABLED";   with SQL1 do begin     SQL1:=TSQLQuery.Create(Self);     Database:= SQLQuery1.DataBase;     Transaction:=SQLQuery1.Transaction;     SQL.Text:='select * from fam order by fam_nom';     Open;      DTS1:=TDataSource.Create(Self);     DTS1.DataSet:=SQL1;       DBLookupComboBox1.ListSource:=DTS1;      SQL1:=nil;     DTS1:=nil; end;// }end; ---------------------------------------------------------------------- rmmm · 2024-08-09 11:38 Hi All components link to this SQL1 is disabled after update other SQL Repair it. thanks a lot. 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    with SQL1 do begin     SQL1:=TSQLQuery.Create(Self);     SQL1.Database:= SQLQuery1.DataBase;     Transaction:=SQLQuery1.Transaction;      SQL1.AfterClose:=@SQLQueryAfterClose;  // <------- HERE      SQL.Text:='select * ...     Open;....  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.SQLQueryAfterClose(DataSet: TDataSet);begin  DataSet.Active:=True;end;