dbcombobox - populating dropdown list from a query and AutoComplete lazarus / 16-Databases ---------------------------------------------------------------------- percentage · 2015-09-01 13:35 I want to populate a dbcombobox dropdown list with the result of a query that searches for what the user typed in it. I wrote this in its OnChange event: Code: [Select]Query.Close; Query.SQL.Clear; Query.SQL.Text := 'SELECT IDX, X FROM Y WHERE X LIKE ' + QuotedStr(DBCombo.Text + '%'); Query.Open; DBCombo.Items.Clear; while not Query.EOF do begin   DBCombo.Items.Add(Query['X']);   Query.Next; end; AutoComplete and AutoDropDown is true. Style: csDropDown. Every time I try to write something and press a key, the dropdown list is populated but appears then disappears, and the match for that letter is autocompleted. I can't write more than one letter, this happens every time I press a key. How do I get the default behavior? ---------------------------------------------------------------------- taazz · 2015-09-01 13:54 use a dblookupcombo instead ---------------------------------------------------------------------- percentage · 2015-09-01 15:03 From what I understand, the ListSource dataset for a dblookupcombobox has to be loaded all at once. In my case it could become too big and slow the application. So I want to retrieve the list items only as needed and only as many as needed.