TDBEdit can't keep its value when set by .Text lazarus / 16-Databases ---------------------------------------------------------------------- Jibal · 2011-12-15 11:47 Hello, I use Lazarus 0.9.31 (CodeTyphon pack) on Vista and I have a problem with TDBEdit: When I set the text of a TDBEdit : Code: [Select] myTDBEdit.Text := 'something'; As soon as I edit another TDBEdit of the current form or if I click on myTDBEdit, the old value of the modified myTDBEdit comes back on it. This doesn't happen when I modify myTDBEdit by actually editing it (click on it, modify the text then go to another control). Any idea to avoid this behaviour ? ---------------------------------------------------------------------- IndianaJones · 2011-12-15 12:05 Have a look at this page for the explanation. http://bugs.freepascal.org/view.php?id=20528 ---------------------------------------------------------------------- Jibal · 2011-12-15 14:10 Thank you, Sir, you made my day...  Using now this: Code: [Select]SQLite3DataSet1.Edit;     SQLite3DataSet1.FieldByName('THEFIELDCORRESPONDINGTOmyTDBEdit').As String :=  'something';     SQLite3DataSet1.Post; It works ! But I still believe that this is a strange (default) behaviour for these TDBEdits... ---------------------------------------------------------------------- dr4cul453xy · 2012-02-11 08:10 Quote from: Jibal on December 15, 2011, 03:10:58 pmThank you, Sir, you made my day...  Using now this: Code: [Select]SQLite3DataSet1.Edit;     SQLite3DataSet1.FieldByName('THEFIELDCORRESPONDINGTOmyTDBEdit').As String :=  'something';     SQLite3DataSet1.Post; It works ! But I still believe that this is a strange (default) behaviour for these TDBEdits... Simpler way to initiate DB values, can be done by : Code: [Select]datasetName.edit; //or datasetName.insert; yourDBEdit1.field.asString := 'Your default string'; yourDBEdit2.field.asInteger := 1; //your integer defaut value ... ... datasetName.post; Hope it help.. Regards, Drx