unit Principal;

interface

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

type
  TfrmPrincipal = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmPrincipal: TfrmPrincipal;

implementation

{$R *.dfm}

procedure TfrmPrincipal.Button1Click(Sender: TObject);
var
  NewFormClass: TFormClass;
  NewForm: TForm;
begin
  NewFormClass := TFormClass(FindClass( 'TFrmConsulta' ));
  //detalhe: esse  string 'TFrmConsulta' pode vir de um campo, edit, banco de dados, arquivo de configuração etc
  try
    NewForm := NewFormClass.Create(nil);
    NewForm.ShowModal;
  finally
    FreeAndNil(NewForm);
  end;
end;

end.
