[solved] dbedit.text loses programmatically set text when it gets focus lazarus / 16-Databases ---------------------------------------------------------------------- marcov · 2016-05-15 21:09 I've a button that arranges a few fields, mostly dbedits by setting them or adding to them.  (dbeditsomething.text:=dbeditsomething.text+',tralalaa'; ) - add a record (dbnavigator "+" symbol) - I press a button and in some button handler I do  a mutation on a dbedit.text - then I focus the dbedit and the changes done in the button handler are gone. Should I do something after editing dbedits.text property to avoid this? ---------------------------------------------------------------------- marcov · 2016-10-08 14:03 I recompiled the application, and this still happens. When entering the dbedit, the text reverts to the last state (empty when inserting, committed value when not). ---------------------------------------------------------------------- marcov · 2016-10-08 14:16 Since it was quite a problem, I continued googling it a bit, and seems that under Delphi this also happens depending on the exact dataset  implementation, the trick is to change the underlying dataset, and refresh the edit. e.g. 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   SQLQuery1.FieldByName(dbitemscur.DataField).AsString:='0'; (I use the datafield to avoid hardcoding field names in many places in this application too much) Anyway, solved! ---------------------------------------------------------------------- LacaK · 2016-10-08 15:03 I use:   dbeditsomething.Field.AsString := ''; ---------------------------------------------------------------------- marcov · 2016-10-09 13:22 Thanks.