To display a form as a modal dialog box
Use the Show method with a style argument of vbModal (a constant for the value 1).
For example:
' Display frmAbout as a modal dialog.
frmAbout.Show vbModal
To display a form as a modeless dialog box
Use the Show method without a style argument.
For example:
' Display frmAbout as a modeless dialog.
frmAbout.Show
Note If a form is displayed as modal, the code following the Show method is not executed until the dialog box is closed. However, when a form is shown as modeless, the code following the Show method is executed immediately after the form is displayed.
The Show method has another optional argument, owner, that can be used to specify a parent-child relationship for a form. You can pass the name of a form to this argument to make that form the owner of the new form.
To display a form as a child of another form
Use the Show method with both style and owner arguments.
For example:
' Display frmAbout as a modeless child of frmMain.
frmAbout.Show vbModeless, frmMain
Using the owner argument with the Show method ensures that the dialog box will be minimized when it’s parent is minimized, or unloaded should the parent form be closed.