Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to access object on form from a menu
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00040403
Message ID:
00040441
Views:
29
>Hi Vladimir,
>
>Thanks for the response! From my menu I was starting the form using DO FORM formname. When I used this the app object was not adding the form to the array (but I still can't figure out why the form object wasn't available elsewhere). I changed my menu command to goApp.DoForm("formname") and now the form is added to the array and available to my code.
>
>Jeff
>
>>Hi Jeff!
>>
>>I've traced some days ago how works an app object. When you open form then
>>an app object refresh his form collection and add new member to form's
>>array. When you close form then app objects refresh form's collection and
>>renumber all members. That's why you can't got an reference by your way....
>>
>>Have a happy day
>>Vladimir Shevchenko
>>
>>> IF goApp.MainMenuVisible = .T.
>>> goApp.aForms(1).chkPrintPreview.Value = 0
>>> ENDIF
>>>
>>> But if the form is closed and then later reopened, I get an error:
>>Unknown
>>> Member aForms.

Hi Jeff,

You can also run your forms using DO FORM myForm NAME MyFormName, and then address your form controls using that name.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform