By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Oct 11 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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?
Oct 11 '07 #2

P: n/a
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.
Oct 11 '07 #3

P: n/a
On Wed, 10 Oct 2007 20:01:22 -0500, Bob Alston <bo********@yahoo.com>
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
Oct 12 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.