unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Mask, DBCtrls;

type
  TForm2 = class(TForm)
    DBEdit2: TDBEdit;
    DBEdit3: TDBEdit;
    DBEdit4: TDBEdit;
    DBEdit1: TDBEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses Unit1;

{$R *.dfm}

procedure TForm2.FormCreate(Sender: TObject);
begin
Form1.ADOTable1.Last;
Form1.ADOTable1.Insert;
end;

procedure TForm2.FormActivate(Sender: TObject);
begin
dbedit1.SetFocus;
Form1.ADOTable1.First;
Form1.ADOTable1.Insert;
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
if Form1.ADOTable1.Modified then
  begin
  Form1.ADOTable1.Post;
  Form2.Close;
  ShowMessage('Данные занесены в таблицу!');
  end;
end;

end.
