Sometimes we need to use forms by using just their names which are stored in strings. Here we can use the Forms collection to add the Form to the collection using the Form's name which is stored in the string and then show it up. Take a look at this function:
VB Code:
Public Function ShowForm(ByVal sFormName As String)
Dim fTemp As Form
'add the form to Forms collection
Set fTemp = Forms.Add(sFormName)
'show the Form
fTemp.Show
End Function
This function takes the Forms name as string and then adds that to the forms collection. This function can be called in this way: