what do you think is the problem.??
The problem is that you don't listen. As I said in my previous post you have to force the user to enter the text both for edCommitBy and edCategory, otherwise it won't work. Another solution is to ingore empty searchboxes, like this:
procedure TForm1.SQLQuery1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
Accept := (
(Pos(UpperCase(edCommitedBy.Text), UpperCase(DataSet.FieldByName('COMMITTEDBY').AsString)) > 0) or
(Trim(edCommitedBy.Text) = '')
)
and
(
(Pos(UpperCase(edCategory.Text.Text), UpperCase(DataSet.FieldByName('CATEGORY').AsString)) > 0 ) or
(Trim(edCategory.Text) = '')
);
end;
Link both searchbox to the same Keypress event:
procedure TForm1.edCommitedByKeyPress(Sender: TObject; var Key: char);
begin
if Key = #13 then
begin
SQLQuery1.Filtered := False;
SQLQuery1.Filtered := True;
end;
end;
Now enter something in the first searchbox(you can leave the second one empty) then press enter. You also need a reset button where you set filtered property to false and empty the serachboxes.
PS: If still not works then attach a sample project because it works fine here.