You can intercept the CTL-Delete key combination. I often do this and replace the function with a Delete button. Here is the code, which goes in the Action method of your MRU or edit field.
if eventInfo.id() = DataDeleteRecord and self.isEdit():
then msgStop("Forbidden:", "You cannot delete records once they have been generated."
eventInfo.setErrorCode(UserError)
endif
***
OR, you can trap for the Delete key in the Keyphysical event of the form and handle it that way. The code is:
if eventInfo.isPreFilter() then
;// This code executes for each object on the form
if eventInfo.vCharCode() = VK_DELETE
then disableDefault
endif
else
;// This code executes only for the form
endIf
The second instance won't prevent them from backspacing out characters, but you can trap for that too. It will make editing hell, however.
Mac
"Do not delve too deeply in the arts of your enemy and so become ensnared by them"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.