if MDIMainForm.MDIChildCount=0 then
begin
ChildIndex:=0;
while (ChildIndex<MDIMainForm.MDIChildCount) and
(MDIMainForm.MDIChildren[ChildIndex].Name<>IMRegisterForm.Name) do
Inc(ChildIndex);
if ChildIndex = MDIMainForm.MDIChildCount then
{create new child here}
begin
Application.CreateForm(TIMRegisterForm,IMRegisterForm);
end
else
{child form already exists so just bring it to the top}
MDIMainForm.MDIChildren[ChildIndex].BringToFront;