How to disable or redefine the Ctrl - hotkey which deletes a record

How to disable or redefine the Ctrl - hotkey which deletes a record

am 11.10.2007 03:01:22 von Bob Alston

Anyone know how to disable or redefine the Ctrl - hotkey which deletes a
record? I have a multi page form that uses 14 records, each record
handles 1-2 pages of the 18 page form. Occasionally , after being there
initially, one of the records becomes deleted. I have found I can cause
this by pressing CTRL and the MINUS key simultaneously. Even the
confirm delete doesn't work.

Any way to redefine the function of CTRL + MINUS?

Bob

Re: How to disable or redefine the Ctrl - hotkey which deletes arecord

am 11.10.2007 17:18:01 von Salad

Bob Alston wrote:

> Anyone know how to disable or redefine the Ctrl - hotkey which deletes a
> record? I have a multi page form that uses 14 records, each record
> handles 1-2 pages of the 18 page form. Occasionally , after being there
> initially, one of the records becomes deleted. I have found I can cause
> this by pressing CTRL and the MINUS key simultaneously. Even the
> confirm delete doesn't work.
>
> Any way to redefine the function of CTRL + MINUS?
>
> Bob

I created a temp from with the following code.

Private Sub Form_AfterDelConfirm(Status As Integer)
DoCmd.SetWarnings True
End Sub
Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
DoCmd.SetWarnings False
End Sub
Private Sub Form_Delete(Cancel As Integer)
If MsgBox("Delete record?", vbDefaultButton2 + vbYesNo, _
"Confirm Delete") = vbNo Then
Cancel = True
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If Shift = 2 And KeyCode = 189 Then
MsgBox "Stop That!"
End If
End Sub

If KeyPreview is set to YES for the form, I see StopThat but the code to
delete never is executed.

If KeyPreview is set to NO, I get the message asking for confirmation.
If I say Yes, the record is deleted. If not, the record is saved from
deletion. You'll notice I set the default of the Yes/No to No.

What version of Access are you running?

Re: How to disable or redefine the Ctrl - hotkey which deletes arecord

am 11.10.2007 17:34:20 von Bob Alston

Salad wrote:
> Bob Alston wrote:
>
>> Anyone know how to disable or redefine the Ctrl - hotkey which deletes
>> a record? I have a multi page form that uses 14 records, each record
>> handles 1-2 pages of the 18 page form. Occasionally , after being
>> there initially, one of the records becomes deleted. I have found I
>> can cause this by pressing CTRL and the MINUS key simultaneously.
>> Even the confirm delete doesn't work.
>>
>> Any way to redefine the function of CTRL + MINUS?
>>
>> Bob
>
> I created a temp from with the following code.
>
> Private Sub Form_AfterDelConfirm(Status As Integer)
> DoCmd.SetWarnings True
> End Sub
> Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
> DoCmd.SetWarnings False
> End Sub
> Private Sub Form_Delete(Cancel As Integer)
> If MsgBox("Delete record?", vbDefaultButton2 + vbYesNo, _
> "Confirm Delete") = vbNo Then
> Cancel = True
> End If
> End Sub
> Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
> If Shift = 2 And KeyCode = 189 Then
> MsgBox "Stop That!"
> End If
> End Sub
>
> If KeyPreview is set to YES for the form, I see StopThat but the code to
> delete never is executed.
>
> If KeyPreview is set to NO, I get the message asking for confirmation.
> If I say Yes, the record is deleted. If not, the record is saved from
> deletion. You'll notice I set the default of the Yes/No to No.
>
> What version of Access are you running?
Thank you. I was focusing on the bigg issue of CTRL + MINUS which I
cannot trap when viewing the table. But OF COURSE I can trap a form
delete via the ON DELETE function. that is GREAT and will address my
specific issue.

Re: How to disable or redefine the Ctrl - hotkey which deletes a record

am 12.10.2007 05:06:04 von Tom van Stiphout

On Wed, 10 Oct 2007 20:01:22 -0500, Bob Alston
wrote:

I would think you could create a do-nothing entry for it in the
AutoKeys macro.

-Tom.


>Anyone know how to disable or redefine the Ctrl - hotkey which deletes a
>record? I have a multi page form that uses 14 records, each record
>handles 1-2 pages of the 18 page form. Occasionally , after being there
>initially, one of the records becomes deleted. I have found I can cause
>this by pressing CTRL and the MINUS key simultaneously. Even the
>confirm delete doesn't work.
>
>Any way to redefine the function of CTRL + MINUS?
>
>Bob