Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

halt access macro

Posted on 1997-05-06
2
1,421 Views
Last Modified: 2006-11-17
I have a macro in Access that has about a HUNDRED steps. These steps are mostly "OpenQuery" commands. I would like to know how to stop/halt the macro in the middle of it. As far as I can tell, if I decide I want to stop the macro before it is finished I have to
KILL  the Access task itself! When the macro is running no menu item or anything else is selectable. I tried CTRL-BREAK and SHIFT-F5 but they didn't work. I know I can single step through the macro but with over a hundred steps in the macro, this is simply not an option.
HOW can I stop execution of macro without having to kill Access itself ?
0
Comment
Question by:massar
2 Comments
 
LVL 3

Accepted Solution

by:
ChrisLewis earned 50 total points
ID: 1008899
First of all, CTRL-Break DOES work, but you're probably hitting it while the queries are running, and its not stopping the macro correctly.  For more control, try these - User interaction:Create a function that brings up a msgbox with yes/no buttons, and return true/false based off the buttons.  Every 5 or 10 lines in your macro, add a line that stops the macro with the condition set to the function.  If you want to stop the macro, you just answer the dialog.  The problem with this is that you have to answer No if you want to continue, and you probably could achive the same results by spliting the macro up.No user interaction:First line of your macro, call a function that creates a junk file in your temp directory.Next, create a function that finds the temp file (using DIR$), and returns true if it exists.  Set the condition on every line in the macro (except the first) to the find function.  If you want to stop the macro, you just delete the file in filemanager/explorer.Try the Ctrl-Break again - it should work!
0
 

Author Comment

by:massar
ID: 1008900
I tried CTRL-BREAK again and it does appear to work. What was happening before is that before a query was run I would get a msg box asking me whether I wanted to update/delete/create table etc... I would
hit CTRL-BREAK at this point and expected the msg box to go away and the macro to stop but it wouldn't so I would kill Access. This time I hit CTRL-BREAK then answered no to the question and got the macro step dialog box with the halt/continue/step button and I just clicked on halt.
I hope this is the way it should work.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is it worth it to buy an Echo? In a word, yes! For me it was definitely worth it. I use mine on a daily basis. Prologue & Privacy At first, I was very skeptical about the Amazon Echo. In general, I don't like voice assistants. I don't li…
A clone is a duplicate copy. Sheep have been cloned and maybe someday even people will be cloned, but disk cloning (performed by the hard drive cloning software) is a vital tool used to manage and protect data. Let’s look at what hard drive cloning …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question