J
John S. Ford, MD
I'm working in Access 97 and am trying to write some code to disable some
keystroke shortcuts, particularly <Ctrl> + Minus which will allow users to
delete records that I don't want them to delete. I've set the key preview
property of the form and it's embedded subform to Yes. I've placed the
following code in both the form and subform:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim CtrlDown As Integer
CtrlDown = (Shift And acCtrlMask) > 0
If CtrlDown And KeyCode = vbKeySubtract Then
KeyCode = 0
End If
End Sub
If I have the cursor on the subform and I hit <Ctrl> + Minus, the current
record STILL gets deleted. Any ideas as to what I'm doing wrong?
John
keystroke shortcuts, particularly <Ctrl> + Minus which will allow users to
delete records that I don't want them to delete. I've set the key preview
property of the form and it's embedded subform to Yes. I've placed the
following code in both the form and subform:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim CtrlDown As Integer
CtrlDown = (Shift And acCtrlMask) > 0
If CtrlDown And KeyCode = vbKeySubtract Then
KeyCode = 0
End If
End Sub
If I have the cursor on the subform and I hit <Ctrl> + Minus, the current
record STILL gets deleted. Any ideas as to what I'm doing wrong?
John