Public Function AddForm()
Dim frm As Form, oldName As String, frmCtrl As Control
Set frm = CreateForm
oldName = frm.Name
Set frmCtrl = CreateControl(frm.Name, acTextBox, , "", "", 100, 100, 1440, 240)
frmCtrl.ControlName = "txtCtrl"
DoCmd.Close acForm, frmName, acSaveYes
Set frm = Nothing
DoCmd.Rename "MyTestForm", acForm, oldName
End Function