unit uTableName;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Buttons;

type
  TfrmTableName = class(TForm)
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    eTableName: TLabeledEdit;
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmTableName: TfrmTableName;

implementation

{$R *.dfm}

procedure TfrmTableName.FormCloseQuery(Sender: TObject;
  var CanClose: Boolean);
begin
  if (ModalResult = mrOk) and (eTableName.Text='') then
   begin
    CanClose := False;
    MessageDlg('Table Name cannot be blank', mtError,[mbOk], 0);
   end;
end;

procedure TfrmTableName.FormShow(Sender: TObject);
begin
  eTableName.SetFocus;
  eTableName.SelectAll;
end;

end.
