Ich habe es eben getestet:
Delphi-Quellcode:
Procedure TForm1.MyButtonClick (Sender : TObject);
Var
TotalRecs, FilteredRecs : Integer;
Begin
MyQuery.OnFilterRecord := FilterMyRecord;
MyQuery.Active := True;
TotalRecs := MyQuery.RecordCount;
MyQuery.Filtered := True;
FilteredRecs := MyQuery.RecordCount;
Memo1.Lines.Add (Format('# filtered records = %d, total = %d',[FilteredRecs, TotalRecs]));
End;
procedure TForm1.FilterMyRecord(DataSet: TDataSet; var Accept: Boolean);
begin
Accept := SomeFilterFunction (FilterMyRecord);
end;
funktioniert auch.
Poste doch mal, was bei Dir nicht funktioniert.