Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Some Help
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Need Some Help
Divers
Thread ID:
00603741
Message ID:
00603741
Vues:
65
I want to open a form by passing the name of the form as a string
to a function. I have:


Public Sub LaunchForm(sFormName As String)

  Dim oWinObj As New WindowObj
  Dim oForm As Form

  Set oWinObj = New WindowObj

  oForm = oWinObj.OpenForm(sFormName)

End Sub


oWinObj is in a class:


Public Function OpenForm(sFormName As String) As Form

  Dim oForm As Form

  Set oForm = Forms.Add(sFormName)
  oForm.Show

  OpenForm = oForm

End Function


Now it I don't try to return the instance of the form (oForm), it
works fine. In other words, if the function above is defined as
a Sub instead of a Function.

I get the error 'Invalid use of property'

Can someone help please?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform