I need help implementing a database search and display function.
The code below works once then raises a runtime error 210 at 1010:****
(the last 4 digits vary). I have tried the same code with an OKOnClick
procedure in the search.pas but that gives me a GPF on the first try.
I think the problem is the searchdlg form not being destroyed and
the second search attempt tries to make a second searchdlg form. I've
tried every way I know to get rid of the darn thing without any better
success. Any help is appreciated but please bear in mind that I am a
beginner and speak beginner-eze.
unit Main;
.
.
.
procedure TFormOpening.BtnSearchClick(Sender: TObject);
var
S : String;
begin
{Calls the Search dialog screen}
SearchDlg.ShowModal;
S := SearchDlg.FindValue.Text;
SearchDlg.Free;
FormDisplay := TFormDisplay.Create(Self);
FormDisplay.StaffDB.IndexName := 'Name';
FormDisplay.StaffDB.FindNearest([S]);
FormDisplay.Visible := True;
end;
Karen Weiss