UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Exit Sub - Stop - Just Stop Now, Office 2010    
 
   
bakersburg9
post May 15 2018, 10:01 PM
Post#1



Posts: 5,129
Joined: 2-November 04
From: Downey, CA


I've searched far and wide for help with this problem, and everything is so complicated - my situation is simple - I have a macro that calls numerous subs and functions - very convoluted - this deals with our companies' North, Central and South region - it extracts data from another worksheet, and puts it in one centralized location... there is a key difference with only the Central region, and it's causing a problem - I troubleshot it, and, stepping through the routine, found exactly where things go bad for the Central region - if it just STOPPED right there, it would be all perfect - so I wrote a sub routine with a CASE statement, which basically said if north or south, do nothing (keep going), if Central
CODE
Exit Sub
- but it kept going - is there like a "Kill" statement, or something to get it to just stop or exit THIS routine ?

Hope that's not too vague...
Go to the top of the page
 
WildBird
post May 15 2018, 10:48 PM
Post#2


UtterAccess VIP
Posts: 3,354
Joined: 19-August 03
From: Perth, Australia


Show more of the code, and are you sure it actually gets to this? Have a message box above it to see if that works for example. Could be that you think it fires, but it overshoots it.

--------------------
Beer, natures brain defragging tool.
Go to the top of the page
 
DanielPineault
post May 16 2018, 05:01 AM
Post#3


UtterAccess VIP
Posts: 5,914
Joined: 30-June 11



My first guess would be that either your Case statement isn't working or you are exiting a sub routine but the main one continues. We'd need to see the entire picture.

--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
dflak
post May 16 2018, 10:12 AM
Post#4


Utter Access VIP
Posts: 6,142
Joined: 22-June 04
From: North Carolina


Put a breakpoint in your code, run it and then step through it using F8 to see what path it takes through the logic.

--------------------
Dan

One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
Please zip and attach samples. It makes life easier for those who have to figure out what you are trying to do. Thanks
Go to the top of the page
 
bakersburg9
post May 16 2018, 11:10 AM
Post#5



Posts: 5,129
Joined: 2-November 04
From: Downey, CA


you're right about the case - it was fixed by changing yes to vbyes - thanks ! cool.gif
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    26th May 2018 - 05:17 AM