Page 1 of 1

real time filtering

Posted: Tue 23 Aug 2005 09:05
by ben
Hello,

my interface has the following options

[ All Records ]
[ Records A ]
[ Records B ]
[ Records C ]
[ Records D ]
...

and a search box:

Search: [__________________]

that filters records inside the selected area. Example:

SELECT * FROM records
WHERE name LIKE 'A%'
ORDER BY name

when user types on the search box "George"

the query will be:

SELECT * FROM records
WHERE name LIKE 'A%' and name like '%George%'
ORDER BY name

---

In my code:

MyQuery1.SQL.Strings[1] := 'WHERE...";
MyQuery1.Open;

---

is this the right way to do it or is there another better trick?

Thanks

Posted: Tue 23 Aug 2005 09:54
by Ikar
Try to use MyQuery1.Filter and MyQuery1.Filtered properties