Pues qué te digo, aún con el truco me gusta más el mío:
Código Delphi
[-]
procedure TForm1.combo1Change(Sender: TObject);
function CondicionCampo(Campo, Valor: String): String;
begin
if LowerCase(Valor) = 'todos'
then Result := '1 = 1'
else Result := Campo + ' = ' + QuotedStr(Valor);
end;
var
whereStr: String;
Begin
whereStr := CondicionCampo('campo1', combo1.text);
whereStr := whereStr + ' and ' + CondicionCampo('campo2', combo2.text);
whereStr := whereStr + ' and ' + CondicionCampo('campo3', combo3.text);
whereStr := whereStr + ' and ' + CondicionCampo('campo4', combo4.text);
Query1.SQL.Text := 'select * from tabla where ' + whereStr;
end;
En gustos se rompen géneros