Doing incremental search in a Query
To do incremental search in a Query, using a TEdit, you must put this code in the TEdit's OnChange Event (this works only in D2/D3):
procedure TForm1.Edit1Change(Sender: TObject);
begin
With Edit1 do
if Text <> '' then begin
Query1.Filter := 'code = '''+Edit1.Text+'''';
Query1.FindFirst;
end;
end;
Another way could be
procedure TForm1.Edit1Change(Sender: TObject);
begin
With Edit1 do
if Text <> '' then
Query1.Locate('code',Edit1.Text,[loPartialKey]);
end;
0 Comments:
Post a Comment
<< Home