Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enable/Disable Menu item
Message
 
To
13/09/2000 10:43:06
Marlou Gargantos
Independent Consultant
Manila, Philippines
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00414768
Message ID:
00416003
Views:
35
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform