Delphi - Filtrado por condicines

 
Vista:

Filtrado por condicines

Publicado por ANTONIO ANIL (4 intervenciones) el 01/08/2006 15:37:46
Hola a todos, quiero ayuda:

Este codigo es para filtrar de acuerdo a una condicion:
Si tengo RB1.check hace un filtrado por lo que se escriba en el Edit1.text.
Si tengo RB2.check hace un filtrado por lo que se escriba en los Edit1.text y Edit2.Text (Hasta aqui me funciona bien)
Si tento RB3.Check deberia hacer un filtrado por los que se escriba en los Edit1.text , Edit2.Text y Edit3.text, pero no hace nada: Que es lo que tiene de malo?

Este es el codigo>
procedure TDist06.SpeedButton2Click(Sender: TObject);
begin
if rb1.Checked then
if (edit1.Text <>'')then

begin
datam6.MATRICULA.Filter := 'CENT_CODIGO ='''+Edit1.Text+'''';
end else

if rb2.Checked then
if (edit1.Text <>'')and (edit2.Text <>'')then

begin
datam6.MATRICULA.Filter := 'CENT_CODIGO ='''+Edit1.Text+''' and CESE_CODIGO ='''+edit2.Text+'''';
end else

if rb3.Checked then
if (edit1.Text <>'')and (edit2.Text <>'')and (edit3.Text <>'')then

begin
datam6.MATRICULA.Filter := 'CENT_CODIGO ='''+Edit1.Text+''' and CESE_CODIGO ='''+Edit3.Text+''' and STATUS ='''+edit3.Text +'''';
end;

datam6.MATRICULA.Filtered := true;

end;

AAnil
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder