Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-12-2019, 07:09 AM   #1
smig
Newly Registered User
 
Join Date: Nov 2009
Location: Israel
Posts: 2,063
Thanks: 82
Thanked 134 Times in 125 Posts
smig is on a distinguished road
Angry weird Cancel behavior

I have a form with a Cancel button
I also set this button as "Cancel"

when I click this button on the form all is OK
but when I click Esc on the KeyBoard I get an error "3059-operation cancelled by user" while trying to update a table.

I tried both running an SQL or using a RecordSet

the form's routine works fine.
The error raises in the routine called this form


Last edited by smig; 07-12-2019 at 08:33 AM.
smig is offline   Reply With Quote
Old 07-12-2019, 08:35 AM   #2
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: weird Cancel behavior

it's a long bug in access while there is a query running and you press the esc key.
there has been no cure on this.
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 07-12-2019, 08:39 AM   #3
smig
Newly Registered User
 
Join Date: Nov 2009
Location: Israel
Posts: 2,063
Thanks: 82
Thanked 134 Times in 125 Posts
smig is on a distinguished road
Re: weird Cancel behavior

doing some search I found this
https://social.msdn.microsoft.com/Fo...orum=accessdev

DoEvents did the trick

smig is offline   Reply With Quote
Old 07-12-2019, 08:42 AM   #4
smig
Newly Registered User
 
Join Date: Nov 2009
Location: Israel
Posts: 2,063
Thanks: 82
Thanked 134 Times in 125 Posts
smig is on a distinguished road
Re: weird Cancel behavior

Quote:
Originally Posted by arnelgp View Post
it's a long bug in access while there is a query running and you press the esc key.
there has been no cure on this.
Thank you
look at my reply

DoEvents, Even in the beginning of the Cancel button code do the trick
Now I have to add it to many forms
smig is offline   Reply With Quote
Old 07-12-2019, 08:49 AM   #5
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: weird Cancel behavior

good for you, you found a solution.
have you tested it on successive esc key.
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 07-13-2019, 04:25 AM   #6
smig
Newly Registered User
 
Join Date: Nov 2009
Location: Israel
Posts: 2,063
Thanks: 82
Thanked 134 Times in 125 Posts
smig is on a distinguished road
Re: weird Cancel behavior

Quote:
Originally Posted by arnelgp View Post
good for you, you found a solution.
have you tested it on successive esc key.
Yes, using DoEvents do the job, and I have no errors

smig is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird WebControl Behavior CedarTree Forms 27 05-06-2019 06:44 AM
Weird VBA behavior ASherbuck Modules & VBA 3 12-25-2011 06:11 PM
Weird SubForm behavior. marimo Forms 10 07-26-2007 01:49 PM
Weird form behavior supa_sumo Forms 0 02-07-2006 02:22 PM
Weird Weird behavior fmm Modules & VBA 0 05-04-2001 06:34 AM




All times are GMT -8. The time now is 10:48 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World