Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling an object in other form
Message
From
06/09/2005 08:27:04
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01046890
Message ID:
01046954
Views:
19
>I have 2 independent forms, the form1 opens form2. From a command button in the form2, i tried to refresh the grid placed in form1, but visual foxpro can not locate the object. I used: form1.object.refresh but it didn't work. I would like to know how can i specify the complete path of an object, to be sure that vfp will find it. I know there's a _screen variable, but i don't know how to use it or if this will be the solution to my problem. Thanks for your time. God bless.
>
>Rodrigo Aguilera
>Digital Media Specialist
>www.RodrigoAguilera.com

First, add a property to your base form class called oParentForm.
Then, in the LOAD event of Form2, you can put code like the following:
IF TYPE( “_Screen.ActiveForm” ) = “O”
  This.oParentForm = _Screen.ActiveForm
ELSE
  This.oParentForm = NULL
ENDIF
This will give you an object reference to the calling form that you can use to manipulate objects on that form.

HTH,
Jim
Previous
Reply
Map
View

Click here to load this message in the networking platform