>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