Escape cancels DAO excute command - Prohibit?

E

Ernie Thomason

In Access 2007, if I run the following command
CurrentDb.Execute "qryAppend", dbFailOnError

and press escape while it's running, an error will be raised:
Run-time error '3059':
Operation canceled by user.

The strange thing is that Access doesn't even need to have focus. This is a
problem because my VB process will stop when a user presses the escape key
while working with another application (as Access is running in background).

Has anyone seen this behaivor before, or know how to stop DAO execute
commands from being interrupted from pressing escape?

Thanks,
Ernie
 
B

bcap

This is appalling. I've tested it and you are indeed correct. I even
tested it in Access 2003 to make sure we're not going insane, and as
expected it does *not* happen there.

I can't see any way to prevent this. You can't even trap the Esc key in the
Form_KeyDown event (although even if you could I don't see how it would
help). Looks like wherever we use the Execute method we're gonna have to be
prepared to catch and handle error 3059. It's gonna look just great to
users (not!) when their Access app throws an error because of something they
did in a completely separate application!

My list of issues with A2007 is already very long indeed. This may just be
the final straw that drives me back to A2003.
 

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