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    
post May 15 2018, 10:01 PM

Posts: 5,189
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
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
post May 15 2018, 10:48 PM

UtterAccess VIP
Posts: 3,362
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
post May 16 2018, 05:01 AM

UtterAccess VIP
Posts: 5,975
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
post May 16 2018, 10:12 AM

Utter Access VIP
Posts: 6,184
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.


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
post May 16 2018, 11:10 AM

Posts: 5,189
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    16th August 2018 - 01:02 AM