K
Kevin S Gallagher
I found this code (pretty sure it was from a MVP) for converting a string
variable to a form object which works fine within a form. Take the code and
place it into a code module and it fails on the second line in regards to
Me.GetType.... any idea how to get this to work outside of a form?
Dim strClass As String =
Reflection.Assembly.GetExecutingAssembly.GetName.Name & ".frmChildOne"
Dim tyOfStringVariable As Type =
Me.GetType().Assembly.GetType(strClass)
Dim frmObject As Object = Activator.CreateInstance(tyOfStringVariable)
Dim f As Form = CType(frmObject, Form)
With f
.ShowDialog()
.Dispose()
End With
Thanks for any insight!!!
variable to a form object which works fine within a form. Take the code and
place it into a code module and it fails on the second line in regards to
Me.GetType.... any idea how to get this to work outside of a form?
Dim strClass As String =
Reflection.Assembly.GetExecutingAssembly.GetName.Name & ".frmChildOne"
Dim tyOfStringVariable As Type =
Me.GetType().Assembly.GetType(strClass)
Dim frmObject As Object = Activator.CreateInstance(tyOfStringVariable)
Dim f As Form = CType(frmObject, Form)
With f
.ShowDialog()
.Dispose()
End With
Thanks for any insight!!!