StopAllMacros doesn't

L

Larry

Created a macro to process new records from a linked Excel file.

1st step is open a form in dialog mode displaying sample list of new records
and prompts user to confirm they have the correct data in the list, with a
'continue' and 'Cancel' button. I want the Cancel button to stop the all
macros.

The Cancel button runs a macro that is just 'Close Form' <the sample list
form> then the action 'StopAllMacros'. The form closes and the original
macro continues.

I've also tried placing the 'StopAllMacros' action in the 'Close Event' in
the sample list form but no good there either.

Is it possibly because I'm running Access 2003 and my database is Access
2000 format??

Any suggestions would be greatly appreciated.
 
L

Larry

My understanding is that StopMacro only stops the current macro.

Here's my flow:
--------------------
1st macro
Open Form
opens dialog form for verification and has "Continue" & "Cancel"
buttons
"Continue" button is macro to close dialog form and return to 1st macro
"Cancel" button is macro to close dialog form and I want to
StopAllMacros here
Run Query1
Run Query2
etc
-----------------------------
If I put StopMacro action in cancel button macro, it just stops that macro
then continues on processing in the first macro.

I realized I could workaround by putting the remaining processing steps (run
query1 run query2 etc) in the 'Contunue' button macro.

But the question still remains why the StopAllMacros action doesn't do
anything. Seems like it will be valuable.

Any ideas. And thanks for the response.
 
T

tina

sorry, i don't get it. the first macro opens the form. what subsequent
actions does it perform, and when?

hth
 
L

Larry

The first macro opens the form in dialog mode. Since the form is in dialog
mode, the first macro pauses, waiting for the form to close before continuing
additional queries for a report.

The form displays a list of records for the user to view and decide if this
is the correct batch of records to process (insuring previous work has been
completed). On the form are buttons for 'Continue' (if the list is correct)
or 'Cancel' (if it's not). 'Continue' simply closes the form and the first
macro continues ... no problem. But, if they choose 'Cancel' I need to
close the form PLUS stop the first macro. For the Cancel button, the 'On
Click' event property executes another Macro that first closes the form, then
performs the 'StopAllMacros' action. The StopAllMacros is supposed to stop
all running macros, as I understand the description. But it doesn't. The
form closes and the first macro continues processing. It appears the
'StopAllMacros' does nothing.

Hope that explanation helps.
 
T

tina

yes, i get it now, thanks. well, i can't tell you *why* the StopAllMacros
action doesn't work; i never used it in my macro days, so i'm not familiar
with it. but yes, i would put the relevant macro actions on the pop-up
form's Continue command button. if the pop-up form *always* opens, i
wouldn't consider that a "workaround", but rather a logical flow to the
programming.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top