S
= Stuart =
I have a project I'm working on that will have lots and lots (20-30 or
more) UserForms. As such, I don't want to pre-load them. Instead, I
want to load them as needed. To do so, I've created a combo box on
each form that lets the user choose what form to go to. The User
picks one from the list then clicks on "OK" button. I then want to
load that form and show it. To make it one bit harder my forms are
all named "frm" + Form name.
For example the forms are named, frmMyForm, frmYourForm, frmHisForm
and the combo box shows "MyForm", "YourForm", "HisForm"
The code I have so far for the OK click routine is:
Private Sub cmdChoose_Area_Click()
vChosen = Me.cmbChoose_Area.Value
vName = "frm" + vChosen
Call FormGoTo(Me.Name, vName)
End Sub
In FormGoTo I have the receiving parameters (vFormFrom, vFormTo)
No matter what I do I can't Load "vFormTo".
I've tried
FormGoTo (vFormFrom, vFormTo as UserForm)
but then I get an error from the calling procedure.
I've tried:
Load vFormTo
Load UserForms(vFormTo)
etc, but with no luck.
Is there any way to do this?
more) UserForms. As such, I don't want to pre-load them. Instead, I
want to load them as needed. To do so, I've created a combo box on
each form that lets the user choose what form to go to. The User
picks one from the list then clicks on "OK" button. I then want to
load that form and show it. To make it one bit harder my forms are
all named "frm" + Form name.
For example the forms are named, frmMyForm, frmYourForm, frmHisForm
and the combo box shows "MyForm", "YourForm", "HisForm"
The code I have so far for the OK click routine is:
Private Sub cmdChoose_Area_Click()
vChosen = Me.cmbChoose_Area.Value
vName = "frm" + vChosen
Call FormGoTo(Me.Name, vName)
End Sub
In FormGoTo I have the receiving parameters (vFormFrom, vFormTo)
No matter what I do I can't Load "vFormTo".
I've tried
FormGoTo (vFormFrom, vFormTo as UserForm)
but then I get an error from the calling procedure.
I've tried:
Load vFormTo
Load UserForms(vFormTo)
etc, but with no luck.
Is there any way to do this?