I am adding a form to an existing program. The Form contains a DBGrid and a Grid search capability. In this program I have several DBGrids with search capabilities. I use the identical procedure code for all.
Here is my code:
procedure TForm_NewVeteran.Edit_SearchChange(Sender: TObject);
var
FieldVal: string;
FieldName: string;
Lo: TLocateOptions;
begin
With Form_Main do
begin
Lo := [];
Include(Lo,loPartialKey);
Include(Lo,loCaseInsensitive);
With Form_Main.ADOQuery1 do
begin
FieldName := 'LastName';
FieldVal := Edit_Search.Text;
If ((Locate(FieldName, FieldVal,Lo)) = false) and
(length(Edit_Search.Text) > 0)
then
begin
MessageDlg('The requested record is not in the dataset.',mtWarning,
[mbOK], 0);
Edit_Search.Text := '';
end;
end;
end;
FieldName := '';
Edit_Search.SetFocus;
end;
In this new Form I get the following error:
[DCC Error] NewVeteran.pas(92): E2003 Undeclared identifier: 'TLocateOptions'
What is going on and what is the solution?
Here is my code:
procedure TForm_NewVeteran.Edit_SearchChange(Sender: TObject);
var
FieldVal: string;
FieldName: string;
Lo: TLocateOptions;
begin
With Form_Main do
begin
Lo := [];
Include(Lo,loPartialKey);
Include(Lo,loCaseInsensitive);
With Form_Main.ADOQuery1 do
begin
FieldName := 'LastName';
FieldVal := Edit_Search.Text;
If ((Locate(FieldName, FieldVal,Lo)) = false) and
(length(Edit_Search.Text) > 0)
then
begin
MessageDlg('The requested record is not in the dataset.',mtWarning,
[mbOK], 0);
Edit_Search.Text := '';
end;
end;
end;
FieldName := '';
Edit_Search.SetFocus;
end;
In this new Form I get the following error:
[DCC Error] NewVeteran.pas(92): E2003 Undeclared identifier: 'TLocateOptions'
What is going on and what is the solution?