CreateForm Question

  • Thread starter Thread starter JonWayne
  • Start date Start date
J

JonWayne

After a CreateForm call, how do you go about opening the form modally, so
that codes following the open call are suspended until the form is closed?
 
Is this what you wanted?

Dim frm As Access.Form, strFrmName As String

Set frm = CreateForm(, "YourFormTemplate")
strFrmName = frm.Name
' Other stuff you need to do...
DoCmd.Save acForm, strFrmName
DoCmd.Close acForm, strFrmName
DoCmd.OpenForm strFrmName, , , , , acDialog
' Your new form is now opened Modaly and the
' next line will not execute until the form is closed
DoCmd.DeleteObject acForm, strFrmName

Ron W
 
Back
Top