Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Still cannot evaluate form data from outside form
Message
De
09/09/1997 13:47:22
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00049151
Message ID:
00049189
Vues:
49
>>>Is there a way to grab the value of a textbox from a form called form1 in myform.scx form a prg? I keep getting 'object form1 is not found'
>>>In the prg I say :
>>>do form myform name form1 linked
>>>?form1.text1.value
>>>I could be missing something simple but have no idea.
>>
>>Folowing is not the best, but 100% proof method:
>>For nLoop=1 to _screen.FormCount
>> If _screen.Forms(nLoop).Name="Form1" && I hope you use unique form names
>> =messagebox("Found: "+_screen.Forms(nLoop).Text1.Value)
>> Endif
>>Endfor
>
>Actually, I got it to work now. Messagebox returns the value I entered into the text box. Does this mean I have to use this array for every textbox on the form? (there are about 15 of them)

Timothy- just use the loop to figure out the number of the form, and then, outside the loop, you can use that subscript to reference the form for whatever properties/values you need to retrieve.
For nLoop=1 to _screen.FormCount
If _screen.Forms(nLoop).Name="Form1" && I hope you use unique form names
formnumber = nloop
endif
cnewvalue = _screen.forms(formnumber).textbox1.value
canothervalue = _screen.forms(formnumber).textbox2.value

HTH

Erik
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform