K
Ken Ismert
As you experienced programmers know, you can instantiate an Access
form, just like any other object, by using its class name:
Dim rFrm as Access.Form
Set rFrm = New Form_YourForm ' form "YourForm"
This syntax allows you to create multiple open instances of a form.
With that background, here is my question:
Is there a simple, one-line way to instantiate a form object using a
string:
sFormName = "YourForm"
Set rFrm = MFOS("Form_" & sFormName) ' MFOS = "Magic Function or
Syntax"
NOTE: Because of the multiple instance requirement, DoCmd.OpenForm
won't work. It can only make one instance of a form.
There doesn't seem to be a CreateObject syntax that works.
I currently use a big Case statement matching the form name to it's
class. This gets to be a pain, because every time I add or remove
forms, I have to edit the function.
Do any of you have an answer?
-Ken
form, just like any other object, by using its class name:
Dim rFrm as Access.Form
Set rFrm = New Form_YourForm ' form "YourForm"
This syntax allows you to create multiple open instances of a form.
With that background, here is my question:
Is there a simple, one-line way to instantiate a form object using a
string:
sFormName = "YourForm"
Set rFrm = MFOS("Form_" & sFormName) ' MFOS = "Magic Function or
Syntax"
NOTE: Because of the multiple instance requirement, DoCmd.OpenForm
won't work. It can only make one instance of a form.
There doesn't seem to be a CreateObject syntax that works.
I currently use a big Case statement matching the form name to it's
class. This gets to be a pain, because every time I add or remove
forms, I have to edit the function.
Do any of you have an answer?
-Ken