|
|
Title | Use a Select Case statement to display multiple instances of a form given its name |
Keywords | form, form name, show form |
Categories | Controls, Software Engineering |
|
|
Use a Select Case statement to decide which kind of form to create.
This program has the advantages of simplicity and that it allows multiple instances of the forms. It has the disadvantage that it requires a potentially large Select statement.
|
|
' Display the named form.
Private Sub cmdShowForm_Click()
Dim frm As Form
Select Case txtFormName.Text
Case "Form2"
Set frm = New Form2
Case "Form3"
Set frm = New Form3
Case Else
MsgBox "Unknown form name"
Exit Sub
End Select
frm.Show
End Sub
|
|
|
|
|
|