(SOLVED) Seeing only unique values in a lookup? lazarus / 16-Databases ---------------------------------------------------------------------- bill0287 · 2013-12-10 23:15 I have a DBF table with a column that has hundreds of rows but on 4 or five distinct value. I want to create a lookup that only returns the uniue values and not all of them. DBLookupCombobox displays everything. How would you recommend doing this? Edit: see comment at the end ---------------------------------------------------------------------- bambamns · 2013-12-11 04:26 Did yo tried with TDBF.Locate ? ---------------------------------------------------------------------- bill0287 · 2013-12-11 05:24 I am trying to use something like DBLookupComboBox on a field so that I can choose a filter value. For example, if the field were: COLOR White Black White Red White White White I would want the LookupCombo to only return these as choices: White Black Red ---------------------------------------------------------------------- bambamns · 2013-12-12 01:53 AFAIK you need an SQL to do it and to achieve it you have to access to DBF with TODBCConnection and TSQLQuery. If you are using Windows , you can use Microsoft dBase driver or Microsoft Access dBase driver to access to DBF. ---------------------------------------------------------------------- bill0287 · 2013-12-17 01:57 FWIW, I found this code that will solve the problem. It is probably only good for smaller datasets but it works nicely in the OnEnter event of the combobox: Code: [Select]var SL: TStringList; begin   SL := TStringList.Create;   SL.Sorted := True; // must be set, otherwise next line has no effect   SL.Duplicates := dupIgnore; // don't accept duplicates   SL.AddStrings(DBLookupComboBox1.Items);   DBLookupComboBox1.Items.Assign(SL);   SL.Free; end;