Am I misunderstanding the keydown/press functions (MSA 3K)?
I have both a button and a keydown and or Keypress sub pointing at a subCancel routine
The cancel button works great and I am certain I have succesfully used these key routines somewhere else with no issues ... but today I am getting Object not found errors in the Parent Screen after I hit the ESC key. My understanding is that the Keycode and or Keyascii when set to 0 should ensure there is no further processing done with the captured key?
Yes I realize the Keydown fires before the Keypress but either one is having the same issue by themselves
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 And Shift = 0 Then
KeyCode = 0
subCancel
End If
End Sub
Private Sub btnCancel_Click()
subCancel
End Sub
Public Sub subCancel()
On Error GoTo Err_ccl
Dim CancelWO As String
CancelWO = "frmWO"
DoCmd.Close acForm, CancelWO, acSaveNo
Exit_ccl:
Exit Sub
Err_ccl:
MsgBox Err.description
Resume Exit_ccl
End Sub
I have both a button and a keydown and or Keypress sub pointing at a subCancel routine
The cancel button works great and I am certain I have succesfully used these key routines somewhere else with no issues ... but today I am getting Object not found errors in the Parent Screen after I hit the ESC key. My understanding is that the Keycode and or Keyascii when set to 0 should ensure there is no further processing done with the captured key?
Yes I realize the Keydown fires before the Keypress but either one is having the same issue by themselves
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 And Shift = 0 Then
KeyCode = 0
subCancel
End If
End Sub
Private Sub btnCancel_Click()
subCancel
End Sub
Public Sub subCancel()
On Error GoTo Err_ccl
Dim CancelWO As String
CancelWO = "frmWO"
DoCmd.Close acForm, CancelWO, acSaveNo
Exit_ccl:
Exit Sub
Err_ccl:
MsgBox Err.description
Resume Exit_ccl
End Sub