TDBLookupComboBox misbehaving lazarus / 16-Databases ---------------------------------------------------------------------- talorigomat · 2016-05-11 23:59 I have three DBComboLookupbox on my form.  Two are behaving normally but the third doesn't.  When my form first open you are able to select values in each of he combolookup box.  If I run my procedure to clear the combolookupboxes they all clear.  However if I run my procedure to perform a search and then next run my procedure to clear the comboboxes then only two of the three clear. Additionally it appears that one of the three (cbxOutcome) keyvalue never gets set whatever is selected.  Here is the procedure I use to clear the dbcombolookupbox 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 TfrmGdlSearch.btnClearClick(Sender: TObject);var  vCnt : integer;begin  ActivateDatasets;  for vCnt := 0 to pnlCriteria.ControlCount -1 do  begin    if pnlCriteria.Controls[vCnt] is TDBLookupComboBox then      begin        TDBLookupCombobox(pnlCriteria.Controls[vCnt]).KeyValue:=False;      end;  end;.....end; I've attached the project files so you can see what is happening.  I'm using Lazarus 1.6 and the database is Firebird.  I've included an sql script to create the tables if you are using another DB. ---------------------------------------------------------------------- balazsszekely · 2016-05-12 05:08 Try this(see attachment). ---------------------------------------------------------------------- talorigomat · 2016-05-12 05:57 Hi GetMem This does work. What change did you make to get it to work properly.  The only obvious change I can see is that you use the form's oncreate event to connect to the database. ---------------------------------------------------------------------- balazsszekely · 2016-05-12 06:52 Quote@talorigomat This does work. What change did you make to get it to work properly. I have absolutely no idea what went wrong but I was able to fix it.  Since the first two has worked, I deleted the third one(Query, DataSource, DBComboLookupbox), then recreated/relinked the components. I know it seems stupid, but sometimes it's much faster then comparing all those properties, you still can do it though if you like, open the dfm file and copy the components one by one, then compare them. ---------------------------------------------------------------------- talorigomat · 2016-05-13 21:16 Thanks.  That did the trick.