You might want to add a SET ESCAPE OFF prior to the critical section.
>Hi all:
>is there any way I can trap or prevent events from happening on a form while I am executing a function in a program file?
>
>I am getting a keypress event in a text box on a form while I am executing a function in a .prg file. This event is causing the function to quit prematurely!
>The function is started from the valid event of that same text box.
>This has serious consequenses to the stability of my program.
>
>What I would like to do is prevent any events from happening while I process my critical function.
>
>Any help or suggestions would be appreciated. I thought about API calls, but can not seem to find any to do that for me.