Solved

Why does Stop not stop

Posted on 2013-12-10
5
294 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

707 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