You can add the below code the called program myprg to trap for it to prevent the error message when it happens:
Parameters oForm
IF TYPE('oform')="O"
wait window oForm.caption
ENDIF
RETURN
DO myprog WITH THISFORM
DODEFAULT()
>I have the following code in Destroy event of a form:
>Do MyPrg with thisform
>
>In MyPrg:
>Parameters oForm
>wait window oForm.caption .......
>
>Most of the time this works but the ODD occasion, an error comes up saying oForm is not an object. I cannot repilcate this myself on testing but it has happened a few times out on site !!!!
>
>Is it possible for the Screen to be destroyed by the time the code is run ? or is there any other reason this would not work ?
>
>Regards,
>
>Gerard
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"