Hi everyone. I'm creating an application inside Access 2007. The application will retrieve data from various locations on my company's network servers.
Depending on the time of day, alignment of the planets, other unfathomable mysteries sometimes my company's network is very, very slow.
I would like to provide the user of my application with a "Cancel" button on a form that will cancel/stop execution of the code (at whatever point it may be at) if the user clicks the button.
Is there some sort of DoCmd method or something else I can call to cancel/stop code execution in Access?
I could use the "CancelEvent" method. But to use this method, I must insert it at pre-determined points in the code, and then test to see if the user has selected the cancel button. It would work, but it's not as instantaneous as I wuld like. Plus, if execution hangs because of a slow network (which is the condition I'm most concerned about) if it doesn't happen to be a the proper spot in my code, the CancelEvents method wont be called.
I could also instruct the user to hit "Ctrl-Break" on the keyboard to stop execution, but that would produce a error dialog box which the user must learn to hit the "End" button. And besides, I don't know if users could REMEMBER the "Ctrl-Break" combination. :-)
Any thoughts or suggestions are greatly appreciated.
Thanks,
sphinney