?
Solved

halt access macro

Posted on 1997-05-06
2
Medium Priority
?
1,426 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
[X]
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
2 Comments
 
LVL 3

Accepted Solution

by:
ChrisLewis earned 100 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

Ransomware Attacks Keeping You Up at Night?

Will your organization be ransomware's next victim?  The good news is that these attacks are predicable and therefore preventable. Learn more about how you can  stop a ransomware attacks before encryption takes place with our Ransomware Prevention Kit!

Question has a verified solution.

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

pc, laptop  monitor connection configurations
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

752 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