Link to home
Start Free TrialLog in
Avatar of TimHudspith
TimHudspith

asked on

Equivalent of Excel's EnableCancelKey in Access?

I want the user of an Access database to be able to interrupt and exit procedures that involve long loops.

I could trap the KeyDown event of <Escape> so that it changes the value of a global variable whose value gets checked within the loop and so permits code execution to pass out of it, but that would slow down the procedure even further.

Does Access have an equivalent of Excel's Application.EnableCancelKey property (set to xlErrorHandler would do the trick), or does anyone have their own improvised equivalent?

Thanks.
Avatar of als315
als315
Flag of Russian Federation image

You can interrupt execution with Ctrl+Break keys.
Avatar of TimHudspith
TimHudspith

ASKER

But that's not a proper solution is it? Variables and objects in the procedure don't get cleaned up properly.
SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial