Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need book to migrate fast from FPW26 to VPW30.
Message
From
10/04/1997 17:36:18
 
 
To
10/04/1997 08:42:57
General information
Forum:
Visual FoxPro
Category:
User groups
Miscellaneous
Thread ID:
00026352
Message ID:
00027861
Views:
73
>The way I am getting around this is to turn the button off once the FORM >has been called. Is there a reason why the below code does not work?
>
>In the CLICK EVENT of the calling button:
>if type("myform") = "O" .and. !isnull(myform)
> myform.show ( I have also used ... myform.show() )
>else
> do form myform
>endif
>
Actually, it's good form to toggle the command button's Enabled value based on the form's existence - I'd do this in the button's Refresh() method. Better user interface and all.

Look at the scope of your variable "myform". If it's out of scope, TYPE() will return "U", which is not what you want. If the form you are trying to open is in function a child of the form that calls it, make it a property of the parent form - i.e. Thisform.oChildForm. Then you would have:

DO FORM someform NAME Thisform.oChildForm

and then:

IF TYPE("Thisform.oChildForm")="O" .AND !IsNull(Thisform.oChildForm)
Thisform.oChildForm.Show()
ELSE
DO FORM someformfile NAME Thisform.oChildForm
ENDIF

C'est claire? :)
--------
David M. Stowell
D. M. Stowell Consulting
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform