>>If oForm.Name=="MyForm"
Just a small point Ed.... The name property is case sensitive. Far better to do this:
If Upper(oform.name) == "MYFORM"
>>Hi,
>> I have a top level form and multiple MDI form. I place toolbar on my top level form and issue _SCREEN.ACTIVEFORM.mymethod(). It works most of the time, but VFP give error ACTIVEFORM is not an Object sometime... why does it happen? hor to solve?
>>
>>Thank you
>
>Sometimes, there is no ActiveForm at that time. It's safer to look for the form you really need, and use its reference to call the method, e.g.
>
>For Each oForm in _SCREEN.Forms
> If oForm.Name=="MyForm"
> oForm.mymethod()
> Exit
> Endif
>Endfor
>