Subject Re: [IBO] how to work with filters?
Author Woody
From: "Alexandre" <alexandrepires2000@...>

> Hi Guys,
> Well, I have a checkbox in my project and I need to filter some records
> when the checkbox is checked.
> Something like this:
> Checked: select * from mytable where status=0
> Not checked: select * from mytable
> How can I do this using TIBOQuery with filters?
> Thanks for some help.

You don't really need filters, you just need to build the query properly.
Something like this would do:

In the checkbox's OnClick handler,

if myQuery.Active then
myQuery.Close;
myQuery.SQL.Text := 'Select * from mytable';
if chkFilter.Checked then
myQuery.SQL.Add('Where status = 0');
myQuery.Open;

HTH
Woody (TMW)