Stopping the escape key being pressed.

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
 
J

John Spencer (MVP)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top