Agnes,
The code in EXECSCRIPT() runs in a different context to the form. When you use macro substitution, it runs in the context of the form. What you could do to reference THISFORM in EXECSCRIPT() is as follows :-
PRIVATE oTHISFORM
m.oTHISFORM = THISFORM
In the EXECSCRIPT code, change the reference(s) from THISFORM to m.oTHISFORM - because you have defined m.oTHISFORM as a PRIVATE variable, it will still be in scope and therefore can be seen by the code in the EXECSCRIPT call.
HTH.
>HI ,
>
>Help me Please .
>
>I use 'Execscript' to run a code which is stored in a table . But an error appeared :'THISFORM can only be used within a method'
>
>with a macro substitution there's no problem . But I want to use 'Execscript'
>
>Regards
-=Gary