Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I pass an object name to another form?
Message
From
02/04/2001 12:37:46
GW Gross
{Banned by Information Security Policy}
Lake Mary, Florida, United States
 
 
To
All
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
How do I pass an object name to another form?
Miscellaneous
Thread ID:
00490967
Message ID:
00490967
Views:
47
Here is the problem. I want to pass an object name to another form, then have that form instantiate the object. I have no idea how.

I tried unsuccessfully, to add a new Property to the form and then use that property name, but that does not work.

Here is what I tried:

In the Calling Form:


frmviewer.ReportName = "crBatchSummaryReport"


In the Called Form:


Private CRDesigner as String

Public Property Let ReportName(InputName As String)

CRDesigner = InputName

End Property

Public Property Get ReportName() As String

ReportName = CRDesigner

End Property

Then in the load event I tried:

Dim crReport as ReportName
Set crReport = New ReportName


This of course errors out, because it is using "ReportName" to define the object, but I want to use the value of "ReportName" which is "crBatchSummaryReport". I find a lot of places where I want to do this, but how do you get VB to use the Value of the string variable and not the variable name itself?

Thanks,
GW Gross

"You are blessed when you're content with just who you are - no more, no less." Matthew 5:5 (The Message)
Next
Reply
Map
View

Click here to load this message in the networking platform