Solved

Casting String to Form

Posted on 2002-07-10
1
130 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 50 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

837 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