
Loading a Visual Basic Form using a String VAR
Hello Robert
You can't do what you want to do in Visual Basic. Not exactly anyway.
what you could do is:
Private MyForms as collection
Myforms.Add Key:=frmFirstForm.Name, Item:=frmFirstForm
Myforms.Add Key:=frmSecondForm.Name, Item:=frmSecondForm
Myforms.Add Key:=frmThirdForm.Name, Item:=frmThirdForm
Then you can do something like:
Dim AForm as Form
Set AForm = MyForms(frmFirstForm.Name)
Aform.Show
Hope that helps you do what you want to do. But it would perhaps be better
if you gave up those old FoxPro ways and did things differently :-D
--
Ibrahim
A MS Developer MVP
====================
Malluf Consulting Services
http://www.*-*-*.com/
===================================
Check out the latest ViewSource column:
http://www.*-*-*.com/
===================================
My {*filter*}: http://www.*-*-*.com/
Quote:
> Can anyone help me?
> I have an array of form names which during the operation of an
application,
> the user would move through a series of steps (the forms).
> I cannot seem to evaluate the contents of the string so that I can the
name
> to enable me to display the form on the screen:
> Dim strFormNames(10)
> StrFormNames(1) = "frmFirstForm"
> StrFormNames(2) = "frmSecondForm"
> StrFormNames(3) = "frmThirdForm"
> I have tried:
> Dim objFormName as Form
> Set objFormName = strFormNames(1)
> objFormName.Show
> ...... This causes an error.
> How do I use the contents of the string, so that I can show the form???
> Please help!!!