I have the following code for a form:
When the user presses Ctrl and j I want the form to close. When I try this the KeyDown event does not get triggered. I am using the exact same code in another project and it works quite well.
tia Jack
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
HandleKeys KeyCode, Shift
End Sub
Public Sub HandleKeys(KeyCode As Integer, Shift As Integer)
Dim ShiftDown As Integer
Const KEY_j = 74
Const CTRL_MASK = 2
ShiftDown = ((Shift And CTRL_MASK) > 0)
Select Case KeyCode
Case KEY_j
If ShiftDown = -1 Then
DoCmd.Close acForm, Me.Name
End If
End Select
KeyCode = 0
End Sub
tia Jack