Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I pass an object name to another form?
Message
De
02/04/2001 12:37:46
GW Gross
{Banned by Information Security Policy}
Lake Mary, Floride, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
How do I pass an object name to another form?
Divers
Thread ID:
00490967
Message ID:
00490967
Vues:
46
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)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform