Blocking "Escape" key ?

INFOS

Registered User.
Local time
Today, 23:32
Joined
Jan 15, 2005
Messages
55
Is there a way to block "Escape" key in a form - to be no reaction at all when I press "Esc"?
 
The KeyPress event will allow you to do that. You must also turn on the Key Preview property to YES and use the following...

Code:
Private Sub Form_KeyPress(KeyAscii As Integer)

    If KeyAscii = vbKeyEscape Then
        KeyAscii = 0
        Beep
        MsgBox "You can not use the Esc key.", vbInformation, "Invalid Key Stroke"
    Else
        'do nothing since they did not use the Esc key
    End If

End Sub
 
Blocking escape not only on a form ?

I did not put my question right. I want to run a query on a form. That
query works with big amount of data and it needs a few minutes to end.
I need to block "escape" key while query runs - becouse "escape" is stoping my query in the middle. If I block this key on a form (keypress) it doesn't help.

Thanks!
 
Do you not have a form active when the query runs [while the user is in the db]?
 
Reply

Form is active but it does'nt helps. Escape key stops the query running.
 
You could use an AutoKey macro to override what the Esc keys normally does. Search the forum and/or Access help files on how to create and use the AutoKey macro.
 

Users who are viewing this thread

Back
Top Bottom