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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top