Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running command in another form from current form
Message
From
26/05/1999 22:32:21
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00223254
Message ID:
00223281
Views:
22
>I am trying to is run a command in a hidden form without the form coming up on screen, but I keep getting errors 'object not found'.
>
>
>my form (frm_statrp) has a cmdreturn button that has following code:
>
>
>&&cmdReturn
>select * from something into array whoknows
>thisform.release()
>
>
>
>my main form called frm_main has the following command to run a command button in frm_statrp
>
>
>do frm_statrep.cmdReturn.click()
>
>
>
>how do I issue a command in another form without leaving current form?
>

You've gotten answers from both Nancy and Bob that address the immediate issue, but the real question is why you need to access code inside a form method from outside the form. From my POV at least, it'd make more sense to move the common code out of the form, perhaps into a business object of some sort, and then pass a reference to the object containing the common method to whatever needs it. If the form and something outside the form need the method code, there's a strong implication, in my mind at least, that the form and whatever is referencing the form's method have a commonality that's forcing you to break encapsulation. Maybe the code belongs to something that the two share in common...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform