>Dear Sir,
>
>When I run your codes, with a command button, the following message appears
>
>"INTERRUPTED"
To me, that seems to indicate that it works!
Perhaps you have to SET ESCAPE OFF, to avoid the interruption of code execution.
>
>Reason to need this command
>
>I have following codes on the keypress event of form
>
>IF LASTKEY()=27
> RELEASE THISFORM
>ENDIF
>
>
>For some reasons I want to close Form with ESC key and do not want to press ESC key mannually. I want to press ESC key programatically.
If sending an ESC programmatically doesn't work, another alternative might be to change a form property:
if lastkey() = 27 or ThisForm.lProgrammaticEscape
release ThisForm.
endif
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)