|
|
Stop all macros - not stopping all macros!
I have a button on a form, which should do different things depending on
1. The data contained within the current record;
2. Whether the current record is a 'new record';
3. Whether the current record is the first record in the form.
On click, an embedded macro is initiated. Each step in the embedded macro
has a condition and a corresponding 'RunMacro' action.
All the conditions are mutually exclusive, and each sub-macro has a final
step of 'StopAllMacros'. So the embedded macro should trigger one, and only
one sub-macro.
However, it appears that what is actually happening is:
1. The embedded macro works through each step sequentially.
2. If a sub-macro is triggered, Access returns to the embedded macro and
continues to work through each step sequentially, regardless of the
StopAllMacros action.
3. Because the sub-macros affect the current record, subsequent conditions
are occasionally met and more than one sub macros are run (often resulting in
error messages).
Have you any idea why the StopAllMacros fail to stop the Embedded Macro? I
only want one sub-macro to run per button click.
|
|
0
|
|
|
|
Reply
|
Utf
|
12/18/2007 2:55:04 PM |
|
This was a bug in the original release of Access 2007.
Check this article:
http://support.microsoft.com/kb/942378
I understand it to say that this issue has been fixed in SP1 for Office
2007.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"RyanLennard" <RyanLennard@discussions.microsoft.com> wrote in message
news:F01DD699-94DC-4B10-85FA-40ECEE944A8D@microsoft.com...
>I have a button on a form, which should do different things depending on
> 1. The data contained within the current record;
> 2. Whether the current record is a 'new record';
> 3. Whether the current record is the first record in the form.
>
> On click, an embedded macro is initiated. Each step in the embedded macro
> has a condition and a corresponding 'RunMacro' action.
>
> All the conditions are mutually exclusive, and each sub-macro has a final
> step of 'StopAllMacros'. So the embedded macro should trigger one, and
> only
> one sub-macro.
>
> However, it appears that what is actually happening is:
> 1. The embedded macro works through each step sequentially.
> 2. If a sub-macro is triggered, Access returns to the embedded macro and
> continues to work through each step sequentially, regardless of the
> StopAllMacros action.
> 3. Because the sub-macros affect the current record, subsequent conditions
> are occasionally met and more than one sub macros are run (often resulting
> in
> error messages).
>
> Have you any idea why the StopAllMacros fail to stop the Embedded Macro? I
> only want one sub-macro to run per button click.
|
|
0
|
|
|
|
Reply
|
Allen
|
12/19/2007 11:36:51 AM
|
|
|
1 Replies
511 Views
(page loaded in 0.039 seconds)
|
|
|
|
|
|
|
|
|