Despues tambien tengo esta codificacion en el primer Form
Código Delphi
[-]var
Form1: TForm1;
Intentos: Integer;
implementation
uses Unit2;
{$R *.dfm}
procedure abre;
begin
Form1.Hide;
Form2.ShowModal;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
apellido, contrasena: String;
ClaveCorrecta: Boolean;
begin
apellido := Edit1.Text;
contrasena := Edit2.Text;
ClaveCorrecta := False;
edit1.Clear;
edit2.Clear;
Table1.First;
edit1.SetFocus;
while Table1.eof = false do
begin
if (Table1.FieldByName('Apellido').AsString = apellido) and
(Table1.FieldByName('Clave').AsString = contrasena) then
begin
abre; Form2.free; Application.Terminate; end;
Table1.Next;
end;
if not ClaveCorrecta then
begin
ShowMessage('Clave o Nombre Incorrectos');
Inc(Intentos);
if Intentos >= 3 then
begin
ShowMessage('Contacte con el administrador');
Application.Terminate;
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close; end;
procedure TForm1.Button3Click(Sender: TObject);begin
form1.Hide;
form2.show;
end;
end.