llXit = .F. on escape llXit = .T. set escape on scan while not llXit ... Processing code here DOEVENTS endifThis works as expected if I just DO FORM.... from the Command Window. However, if I call it from the menu of my app, it either ignores the Escape key or hangs. The menu option is just a command that says DO FORM... just like I do from the command window. The form has a private datasession.