Solved

halt access macro

Posted on 1997-05-06
2
1,416 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

this article is a guided solution for most of the common server issues in server hardware tasks we are facing in our routine job works. the topics in the following article covered are, 1) dell hardware raidlevel (Perc) 2) adding HDD 3) how t…
In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now