Hej, da się jakoś połączyć dwa filtry dla ADOTable?
W sensie, że użyje pierwszy filtr, wyświetli mi w Dbgridzie pasujące elementy. Następnie dla tej samej tabeli użyje drugi filtr, który będzie brał pod uwagę elementy z poprzedniego filtra. Obecnie jest tak, że oba filtry filtrują z całej zawartości ADOTable (jeden anuluje drugi).
Tak wygląda fragment kodu:
begin
DaMod.ATWyc.disablecontrols;
DaMod.ATWyc.first;
while not DaMod.ATWyc.eof do
begin
if tabela.Text = 'IdWycieczki' then
begin
if ZnakRownosci.ItemIndex = 0 then DaMod.ATWyc.Filter:='IdWycieczki = ' + WartoscFiltr.Text
else if ZnakRownosci.ItemIndex = 1 then DaMod.ATWyc.Filter:='IdWycieczki > ' + WartoscFiltr.Text
else if ZnakRownosci.ItemIndex = 2 then DaMod.ATWyc.Filter:='IdWycieczki < ' + WartoscFiltr.Text;
end
else if tabela.Text = 'Koszt' then
begin
if ZnakRownosci.ItemIndex = 0 then DaMod.ATWyc.Filter:='Koszt = ' + WartoscFiltr.Text
else if ZnakRownosci.ItemIndex = 1 then DaMod.ATWyc.Filter:='Koszt > ' + WartoscFiltr.Text
else if ZnakRownosci.ItemIndex = 2 then DaMod.ATWyc.Filter:='Koszt < ' + WartoscFiltr.Text;
end;
DaMod.ATWyc.Filtered := true;
DaMod.ATWyc.next;
end;
DaMod.ATWyc.first;
DaMod.ATWyc.enablecontrols;
end;
A tak okno (bez filtrowania):