Subject | Re: [IBO] how to work with filters? |
---|---|
Author | Woody |
Post date | 2013-07-02T17:58:21Z |
From: "Alexandre" <alexandrepires2000@...>
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)
> Hi Guys,You don't really need filters, you just need to build the query properly.
> 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.
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)