Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong with the following code?
Message
De
23/09/1998 19:54:41
 
 
À
23/09/1998 18:53:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00140095
Message ID:
00140126
Vues:
25
>Hi,
> In the click event procedure of a command button, Iam trying to launch a modal form (custfind.scx) and see couple of properties of custfind object once the launched form is closed.
>
>Right after the "do form.." line, Iam getting an error saying "dlgFind" is not object.
>
>What am I doing wrong?
>
>Iam giving below the code.
>
>Thanks
>Puri
>
>======The code==================
>local dlgFind
>do form findcust.scx name dlgFind linked ;
> with thisform.txtCustomer.Value
>if m.dlgFind.m_nCustId <> -1
> ? "The customer id is " + Str(dlgFind.m_nCustId)
> ? "The customer name is "+m.dlgFind.m_sCustName
> thisform.txtCustomer.Value = m.dlgFind.m_sCustName
>endif
>
>=============================

When you launch a modal form, control is passed to that form until the form is unloaded. By the time your next line of code is run (after DO FORM), the form is gone. To get a value back from a modal form, pass it back from the form's unload event.

do form findcust.scx TO CustName

and then in form unload:
RETURN THIS.txtCustomer.Value

Custname will hold the value you return.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform