Thanks Martin.
We thought about using the same approach, but didn't go that way (yet), may be because we always used field level validation.
For now, we use the cancel property of command buttons.
When the form is not in add/edit mode, the form's Exit button has the cancel property .t.
When the form goes in add/edit mode, we set the cancel property of the Cancel button to .t. and in any valid that may return .f. we have:
if lastkey()=27 or lastkey()=17 (ctrl+q - the menu shortcut)
return .t.
endif
... the valid code here ...
dz
Doru