Cancel Key Breaks Out Of Code (1 Viewer)

jlsyst

New member
Local time
Today, 03:38
Joined
Jun 17, 2008
Messages
2
I have a strange problem related to this post that I would love some help with. As a background, the code base I am referring to here is a commercial database distributed under Access Runtime
2003 for a number of years now without issue.

Upon converting this application to Access Runtime 2007 and distributing it, the code all apparently works well except that I am
seeing some strange behavior, specifically, that if you hit the <ESC> key on the keyboard at any time when some module code is
running (e.g. when saving an order or adding a contact) then Access immediately stops what it is doing in the background and
indicates that the User has canceled the operation (error #3059).

Essentially as long as the user keeps his hands off the keyboard, all works well. This was not a problem in Access 2003 and the
code is the same so something must be different in the environment.

I have explored several options such as:
1) DoCmd.SetWarnings False when the application first opens (Result= no effect - msg came up regardless so this 3059 is
apparently not considered a warning and is more of an error)
2) Using the AutoKeys macro to intercept the {ESC} key (Result= wasn't allowed. Apparently only a subset of the SendKeys
character set can be used in this macro and the {ESC} key is not one of them)
3) Trying to suppress the error using the OnError function in the forms (Result=no effect - msg would come up without being
trapped)

My questions:
*Can anyone help me understand why this is different from the 2003 environment?
*Is there a way to disable the keyboard during code exec?
*Any other ideas on what I can do?!

Thanks in advance
Jerry :confused:
 

Users who are viewing this thread

Top Bottom