method action(var eventInfo ActionEvent) var currentForm Form ; will hold pointer to the current form endvar if eventInfo.isPreFilter() then ; This code executes for each object on the form. ; First check to see if the event is DataDeleteRecord ; If so, prompt for confirmation if eventInfo.ID() = DataDeleteRecord then ; If response is no, disable the action if msgQuestion("Are you sure?", "Are you sure you want to delete this record?") = "No" then disableDefault else currentForm.attach() ; Populate the currentForm variable if not currentForm.Editing then ; This means the form is not in edit mode. We must be ; in edit mode to delete the record, so.. currentForm.action(dataBeginEdit) ; begin edit mode doDefault ; do default now currentForm.action(dataEndEdit) ; end edit mode else ; This means the form is in edit mode. Because we do ; not disableDefault, Paradox will go ahead and complete ; the event processing (delete the record) when this ; routine finishes endif endif endif else ; This code executes only for the form. endif endmethod method keyPhysical(var eventInfo KeyEvent) var currentForm Form ; will hold information on the current form endvar if eventInfo.isPreFilter() then ; This code executes for each object on the form. ; First check to see if the event is Ctrl+Del ; If so, prompt for confirmation if eventInfo.IsControlKeyDown() and eventInfo.vchar() = "VK_DELETE" then ; If response is no, disable the action if msgQuestion("Are you sure?", "You pressed Ctrl+Del. " + "Are you sure you want to delete this record?") = "No" then disableDefault else currentForm.attach() ; Populate the currentForm variable if not currentForm.Editing then ; This means the form is not in edit mode. We must be ; in edit mode to delete the record, so.. currentForm.action(dataBeginEdit) ; begin edit mode doDefault ; do default now currentForm.action(dataEndEdit) ; end edit mode else ; This means the form is in edit mode. Because we do ; not disableDefault, Paradox will go ahead and complete ; the event processing (delete the record) when this ; routine finishes endif endif endif else ; This code executes only for the form. endif endmethod method keyPhysical(var eventInfo KeyEvent) var currentForm Form ; will hold information on the current form endvar if eventInfo.isPreFilter() then ; First check to see if the event is Ctrl+Del if eventInfo.IsControlKeyDown() and eventInfo.vchar() = "VK_DELETE" then currentForm.attach() ; Populate the currentForm variable if not currentForm.Editing then ; This means the form is not in edit mode. We must be ; in edit mode to delete the record, so disable the event. msgStop("Cannot Delete Record", "You must be in edit mode to delete a record. " + "Switch to edit mode first.") disableDefault else ; Prompt for confirmation if msgQuestion("Are you sure?", "You pressed Ctrl+Del. " + "Are you sure you want to delete this record?") = "No" then disableDefault else ; This means the form is in edit mode. Because we do ; not disableDefault, Paradox will go ahead and complete ; the event processing (delete the record) when this ; routine finishes endif endif endif else ; This code executes only for the form. endif endmethod