Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Casting String to Form

Posted on 2002-07-10
1
Medium Priority
?
135 Views
Last Modified: 2010-05-02
I have names of my forms in the string variables.
How can I put them to the form variables.
For example:

Dim form1 as Form
Dim strName as String
strName="NameOfTheForm"

How can I do this :
Set form1=strName  ???? This is not right
Thanks.
0
Comment
Question by:Vadimka
1 Comment
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 7143740
Set form1 = Forms.Add(strName)

Will open the form referenced in strName and assign the object to the form1.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question