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
Utf
12/18/2007 2:55:04 PM
access.queries 6343 articles. 1 followers. Follow

1 Replies
2477 Views

Similar Articles

[PageSpeed] 32

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
Allen
12/19/2007 11:36:51 AM
Reply:

Similar Artilces:

disable snap-to while dragging tab stops?
How do I drag a tab stop to arbitrary position without it snapping to the tick marks on the ruler? I tried holding down shift, ctrl, alt. None of them works. I even turned off everything in the arrange->snap menu. Publisher 2003. Set the tab to about where you want it, zoom to 200%, open the tab dialog and input the number where you want the tab positioned, click set. The tab button can be dragged to your toolbar by customizing. This is the best that Publisher can do... -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "p...

stops responding
A few days ago while trying to balance one of my accounts, Money would start hanging and I had to kill the process and created a LRD file. My file is only 12MB and it has been fine until recently. I am using Money 2007. I should have put my system specs. I have a P4 3.8GHZ w/ 2GB RAM running XP Pro. When I have Money open, I typically only have Messenger, a browser, and sometimes Acroabat Reader running also. "Casey" wrote: > A few days ago while trying to balance one of my accounts, Money would start > hanging and I had to kill the process and created a LRD file. ...

Macro to create charts
I recently had this question answered very comprehensively. However, I've been told that I need to show my data on a chart in % form. Can anyone help modify the following macro to automatically generate charts where the source data is on a row by row basis with four columns showing data (don't need to show targets on this one). I've tried to modify it myself, but can't seem to get it working. The columns are all next to each other - no gaps. To clarigy, I need Name, %Score1, %Score2, %Score3 & %Score 4. That's it. Regards, JDB Jon Peltier In: microsoft.publ...

blue stop screen 0x0000007E
stop error code after windows installs drivers. this is new hdd and mobo but problem persists.oxoooooo7e (oxf748eobf oxf78da2o8,oxf78d9fo8....was doing it with last mobo and hdd...help please!!! -- thanks one and all for your helping hands xerxies wrote: > stop error code after windows installs drivers. this is new hdd and > mobo but problem persists.oxoooooo7e (oxf748eobf > oxf78da2o8,oxf78d9fo8....was doing it with last mobo and hdd...help > please!!! That *is* a driver issue. You are installing the incorrect drivers or need to contact the manufacturer of said ...

recipient policy stopped working
Hello All, I'm seeing an issue in my Exchange 2003 environment where an admin will create a new account and the recipient policy does not populate the users email address. This just started happening a few days ago here in the US... It happened in our UK office last week but I thought that might have been user error on the admin. We are in mixed mode with Exchange5.5, which we have been for almost a year. I did how ever remove some old 5.5 servers but the last one I removed was almost a month ago, so i don't think it would be that. I know you need to ask this question so yes th...

How do I stop a cc email to myself from going to deleted folder
Sometimes when I send an email, I want to keep a copy ofr myself. When I enter my email address in the cc part, this always goes straight to the deleted folder, even though I have my email listed as a safe sender. Any suggestions? On 13/03/2010 01:53, technochallenged wrote: > Sometimes when I send an email, I want to keep a copy ofr myself. Outlook automatically keeps a copy of every email you send in the Sent Items folder. There is no need to cc yourself. "technochallenged" <technochallenged@discussions.microsoft.com> wrote in message news:D4...

is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data?
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? i mean xls not xsl "Daniel" <softwareengineer98037@yahoo.com> wrote in message news:eDjijGEeFHA.2584@tk2msftngp13.phx.gbl... > is it possible to execute write to the fields in another .xsl form a macro > in another .xsl? e.g. some way to load another .xsl into an .xsl macro and > write to its data? > > Both workbooks are open? workbooks("book1.xls").worksheets("sheet1")...

About Macros
Hi .. All.. i am a S/W Test Engineer. Actually I have a new job on macros(my bos gave me). I don't know all the functions of macros. I just know that these ar used for Short cut keys (just like automation)... I would like to know 1. What are the additional functions of Macros? 2. How these macros are used in Other Addin like VB Applications.... ? 3. If I have a Excel Template Then How can I use These templates i Macros Programming? 4. How to write code (For macros) to access the data from V Application and produce reports in form of charts ,and reports. Any help/suggestions/arti...

3197: The microsoft Jet Database Engine stopped the process because you and another user are attempting to change the same data at the same time
Hello, I have a fairly large (For Access - its slated to be transferred to MySQL) backend that allows the user to use the database's front end normally to store and retrieve data. However when I try to open the database I get the Error "The microsoft Jet Database Engine stopped the process because you and another user are attempting to change the same data at the same time". This isn't true because I have it on my local computer. I've tried importing to a new DB file and I get the same error. The original DB will not open to allow import (show table list) and show er...

Stop 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 act...

formula or macro? whichever, I need help
I have a cell/column with 9-digit social security numbers, no spaces, no dashes. I need the last 4 numbers of each cell copied into a seperate cell/column. I can't find anything about copying partial cell value. Can anyone please help? Thank you, Dagmar Livingston, Columbus, GA =RIGHT(A1,4) -- Kind regards, Niek Otten "daggyfresh" <daggyfresh@discussions.microsoft.com> wrote in message news:AD76AFE1-51CF-426F-A09B-DD8A76696122@microsoft.com... >I have a cell/column with 9-digit social security numbers, no spaces, no > dashes. I need the last 4 numbers of...

Macros Error:
I got error message: The macros in this project are disabled. Please refer to the online help or documentation of the host application to determined how to enable macros. (microsoft visual basic) (microsoft outlook 2003). I need your help with this command then tell me to do. Thank you for helping, david Tools | Macro | Security Restart Outlook after you change the setting.=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Pow...

Macro unexpectedly jumps to other macros and functions
Greetings! I've spent hours trying to figure out why the following subroutine unexpectedly jumps to another subroutine [Sub ToggleButton1_Click()] when it hits the line "Worksheets("Mirrors").ToggleButton1.Value = False" in the macro below. What would automatically trigger this macro to jump into another macro - especially when I have the line "Application.EnableEvents = False" at the beginning of this macro? Also, if I rem out the line "Worksheets("Mirrors").ToggleButton1.Value = False", the macro will instead jump to a user fu...

Saving Personal Macro Workbook
Recently, my Excel 2003 has started prompting me to Save my Personal Macro Workbook every time I close to Excel--even when I don't add anything to it. In fact, right now, my don't have anything at all in my Personal Macro Workbook. I've checked for any rando code in a Shhet or in the Workbook, and I can't find any. Anybody know how I can stop this from happening? tj Did you recently upgrade from a previous version of excel? Did you copy over your older version of your personal.xls file? If yes, then excel likes to recalculate workbooks saved in older versions of exce...

Stopping the scroll bar
Hi all, this is my first time. I don't know if this is the right place for this problem but here I go. I have created a template of an invoice the size of an A4 and would like to stop the scroll bar moving both horizantally and vertically in normal view just as if it was in print view. Is that possible through VBA and if yes what is the code that I would need to achieve such task. Thanks in advance --- Message posted from http://www.ExcelForum.com/ Not too sure what you are after but you can remove the scrollbars with <Tools - Options> and then in the View tab, at the bottom,...

Using a macro question.
Can you execute a macro from inside a formula? IF(A1="Y",execute.macro,"") Thanks Adam, not with a formula, but you can use a worksheet change event like this, put in sheet code Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count > 1 Then Exit Sub If Target.Address = "$A$1" And UCase(Target.Value) = "Y" Then 'put your code here End If End Sub -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Usin...

Macro Code
You'd think this would be simple... How do I get a macro to move down 1 cell? I just want a macro to copy the contents of one cell to the cell below it. I have already done this: Sub CopyDown() ' ' CopyDown Macro ' ' Keyboard Shortcut: Ctrl+d ' Selection.Copy Range("A122").Select ActiveSheet.Paste End Sub I want the A122 to be the cell below where the cursor happens to be when I kick off the macro. Any help would be appreciated. Amy Got it from the last thread... thanks! "cvgairport" wrote: > Yo...

Stopping a Campaign Temporarily
Hi, My client has executed the campaign in Jan 1st 2006 and the end date is Dec 31st 2006. But he wants to stop the campaign temporarily from 15th July 2006 and again start it from 1st Aug 2006. So what is that I need to do for this thing, i have never come across this kind of situation before. Thanks in advance. Regards, Shabbir. ...

re Macro
Thanks to those who offered help but I still am not quite there with the correct solution. R.Venkataraman's code was almost correct but I don't think I explained myself correctly. In my sheet1 the user inputs numbers (1-50) in column A.(pluss loads of other data in columns B:P) what I require is the macro to ask the user to input the 'job' they want to print. So if the user inputs <9> then column A in sheet 1 is searched for the number 9 then the contents of that particular row are copied (without formula - just cell values) and the data pasted onto row A2 of sheet...

Would you stop for a moment?!
Excuse me!! Would you stop for a moment?! O...man...Haven't you thought-one day- about yourself ? Who has made it? Have you seen a design which hasn't a designer ?! Have you seen a wonderful,delicate work without a worker ?! It's you and the whole universe!.. Who has made them all ?!! You know who ?.. It's "ALLAH",prise be to him. Just think for a moment. How are you going to be after death ?! Can you believe that this exact system of the universe and all of these great creation will end in in nothing...just after death! Have you thought, for a second, How to save you...

Macro to change Chart Range when inserting a column
I have created a workbook to use as a weekly reporting tool for different sites across the country. It contains a "Report" sheet and a "Data" sheet. There are 4 charts embedded into the Report sheet. I have set-up the Data sheet to have the data titles in Column A, a 12-week summary in Column B, and the weekly data begins at Column C. For the 12-week, I used the formulas =sum($C$1:$P$1) and on the Chart series, I used =Data!$C$1:$P$1. I designed the sheet so a center would insert a column at Column C each week for the most recent data. Unfortunately, everytime th...

checking for existance of file before running macro
I have a macro that opens a source file to retrieve information. I want to be able to check to see if it's there first and if it's not send a msg to the user stating that the file isn't there. When the user clicks okay on the box I want the macro to end without error. Can anyone help? thx, Jim You can use the Dir() function: dim myFilename as string myfilename = "C:\autoexec.bat" if dir(myfilename) = "" then 'it's not there else 'yes, it is end if Jim wrote: > > I have a macro that opens a source file to retrieve information. I wan...

Stop
I have two items in my register, one a transfer to my bank and another a deposited item. I made one bank deposit for the combined amount. When it cleared, I matched it against the two items and all seemed fine. Problem is that every day Money shows the item again as an unmatched item and I have to delete it constantly. I realise this system isn't to well written, but is there any way to have this not show up. After all it was matched and accepted once. In microsoft.public.money, John Barnes wrote: >I have two items in my register, one a transfer to my bank and another a &g...

how do you stop spam?
I'm taking care of a Windows NT Server (4) with Exchange 5.5 SP2 installed. We have around 40 employees in the company and they have been complaining about spam. Desktops are running Outlook 2000. Is there a way to stop spam without installing a third party software? Any help is appreciated. Thanks. there is an open source one available. i think it is on sourceforge.net. search for smtp. mike "Peter McCaul" <compcoff@hotmail.com> wrote in message news:ujtLb2riEHA.1140@tk2msftngp13.phx.gbl... > I'm taking care of a Windows NT Server (4) with Exchange 5.5 SP2...

Sending and Receiving Email stops after installing Exchange 2003 SP1
I've installed Exchange 2003 SP1 and sending and receiving email has stopped. All services are running. Messages seem to be in the local delivery queue. Any suggestions? Thanks. I've been fighting the same thing. Users get -- 800ccc0f or 8004210 Machine is DC, running ADC --- HELP ! ! ! Hi Dan Had same problem, try to stop all Exchange and web (IIS especialy) manualy. ' Then reinstalle PS1, it solved my problem. Carsten "Dan" <dslaby.no2spam@evergreeninfo.biz> wrote in message news:<Ov0nh5DREHA.3732@TK2MSFTNGP11.phx.gbl>... > I've install...