procedure TForm1.sEdit1Change(Sender: TObject); var a :integer; begin IF sEdit1.Text <> '' then begin a:=strtoint(sEdit1.Text); adoquery1.active:=false; adoquery1.sql.clear; ADOQuery1.SQL.Add('select * from employé where num_emp='+inttostr(a)); adoquery1.open; end else begin adoquery1.active:=false; adoquery1.sql.clear; ADOQuery1.SQL.Add('select * from employé'); adoquery1.open; end; end; can you code like this with the fields and conditioning i have mentioned, would it work?