Stopping the escape key being pressed.

  • Thread starter Thread starter David Mc
  • Start date Start date
D

David Mc

i currently have a form which opens from another form.
This form passes a number to the new form, the problem i
have is when the user presses the escape key the data is
lost. How can i disable the escape key for a short period.

Thanks

david
 
You would have to trap the escape key on the form

UNTESTED AIRCODE for the Form's key down event

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
KeyCode = 0
End If
End Sub

Also, you need to set the form's KeyPreview Event to True/Yes

That should do it.
 
Back
Top