Topic: Best way of filtering
Hello all,
I was wondering if you would do this some other way or not.
I have a simple form, with a Combobox, an Edit Box, a Button and a Tablegrid.
The Combobox is filled based on a table that has hundreds of entries so to help the user find what he wants, he can type in the Edit a few letters that will filter the combobox.
Then he makes his choice and presses the button to diplay result in Tablegrid.
Everything works fine with this code for pre-filtering of the Combobox.
procedure Form1_ComboBox1_OnDropDown (Sender: string);
var
like : String;
begin
like := Form1.Edit1.Text;
if like = '' then
begin
Form1.ComboBox1.dbSQLExecute('SELECT id, artist_name FROM artist' );
end
else if like <> '' then
begin
Form1.ComboBox1.dbSQLExecute('SELECT id, artist_name FROM artist WHERE artist_name LIKE "%'+like+'%"' );
end;
end;
But then I noticed the "Filter" property of the Combobox in the Object Inspector. Do you use this to pre-filter you comboboxes are is it something completely different ?
Cheers
Mathias
Each time I get a divorce, I keep the house
Zaza Gabor