?
Solved

Why does Stop not stop

Posted on 2013-12-10
5
Medium Priority
?
295 Views
Last Modified: 2013-12-11
I often get the condition where a Stop line of code gets ignored.  The only solution I have found is to create a new database and import everything into it.

Does anyone know why this happens and if there is anything I can do to prevent it?

Thanks in advance.
0
Comment
Question by:CRB1609
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 15

Expert Comment

by:ChloesDad
ID: 39710697
The obvious answer is that the line is not being executed, and hence the breakpoint never happens.

Alternatively, if you are running in Release mode then breakpoints are ignored.
0
 

Author Comment

by:CRB1609
ID: 39710710
1. The immediate preceding and subsequent lines are being executed.

2. I'm running a normal accdb.
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 39710945
CRB1609: You included the .NET zone here. Are you using VB.NET for this, or is this all contained in Access? I believe the comment from ChloesDad is intended for the .NET languages, which have a Debug and Release mode ...

==============================

Assuming this is an all-Access project, then issues like this are a sign of corruption in the database, and moving to a new container as you're doing now is the only real "fix" for it.

Corruption happens for many reasons, but to reduce the chances:

-- Never modify code in break mode. Never.

-- Split the database into a Backend (tables only) and a Frontend (everything else). The chances for corruption are much greater for forms/reports, etc than for tables.

-- Turn OFF Name AutoCorrect. You don't need it. You really don't.

-- Compile your code frequently. To do that, from the VBA Editor window click Debug - Compile, fix any errors, and continue doing this until the Compile option is disabled. When you make code changes, you'll have to compile again.

-- Don't use 3rd party controls or libraries unless they are compliant with Access (and there are very, very few of those). Just because "it works" doesn't mean it works. This includes ALL Microsoft Controls as well (none of them are "compliant" with Access 2010).

-- Compact your database frequently. In 2010 the Compact option is right on the main backstage menu, so get in the habit of doing this frequently.

-- Never work on a live database.

-- Decompile your code occasionally. This helps to clean up the PCode contained in Access, which can get out of whack occasionally. To Decompile, build a shortcut with a Target like this:

  "Full path to msaccess.exe" "full path to your db" /decompile.

Run that shortcut, then compile and compact

-- Always work on LOCAL copies of the database. Never try to open a remotely hosted database across the LAN - even on local networks. Move the file to your machine and do the work there.

-- Make backups frequently. This doesn't help to reduce corruption, but it puts your mind at ease.

-- Make sure your Office system is fully up to date in regard to service packs, updates, etc. Same goes for Windows.
0
 
LVL 12

Expert Comment

by:pdebaets
ID: 39712570
If you are executing in runtime mode, the Stop statement will not execute.
0
 

Author Closing Comment

by:CRB1609
ID: 39712956
Very helpful.  Doing some of it but the other stuff is great.  

Thanks very much.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question