Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Enable/Disable Menu item
Message
 
À
13/09/2000 10:43:06
Marlou Gargantos
Independent Consultant
Manila, Philippines
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00414768
Message ID:
00416003
Vues:
36
>Hello Allen!
>
>Ok. But I just can't figure this out. Please help me!
>How to simplify my code below through scripting?
>
>Select Case iMode
>Case 1
>    frmCustomer.AddRecord
>Case 2
>    frmSupplier.AddRecord
>Case 3
>    frmAgent.AddRecord
>Case 4
>    frmSalesInvoice.AddRecord
>Case 5
>    frmPurchaseInvoice.AddRecord
>Case 6
>    frmPurchaseOrder.AddRecord
>End Select
>
>In VFP, above code could be simplified this way:
>
>cFormActive = WONTOP()
>strExecute = cFormActive+'.AddRecord'
>&strExecute
>
>I already tried below code in VB but to no avail:
>
>Dim strForm As String
>strForm = ActiveForm.Name
>oScript.Eval (strForm & ".AddRecord")
>
>or
>
>oScript.ExecuteStatement strCommand & ".AddRecord"
>
Have you tried?:

ActiveForm.AddRecord
George
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform