Solved

Why does my Access VBA code not stop at breakpoint

Posted on 2016-09-01
5
82 Views
Last Modified: 2016-09-01
My Access VBA code does not stop at breakpoints. How can I fix that please?
I have set breakpoints and "STOP's", but the code just runs past them. See my code below. I do get the message, but the code does not stop.
Demo debugger does not stop.
0
Comment
Question by:Fritz Paul
[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 84
ID: 41779615
If breakpoints are not working, then often you have troubles with your database. Make a backup, then do this:

1. Compact the application
2. Compile the application. From the VBA Editor window click Debug - Compile. Fix any errors, and continue doing this until the Compile menuitem is disabled.
3. Compact again

You may also need to decompile. To do that, create a shortcut with this as the Target:

"full path to msaccess.exe" /decompile

Run that shortcut, and select your database when Access opens. Access will decompile your code and leave your database open. After your database is open, run the 3 steps above again.

You may also have container corruption. If so, often the only fix is to create a new, blank database and import everything from the old database into the new one. If you have a corrupt object, however, this may not work, as Access will choke on the import of the corrupt object. If that occurs, then you must import each object individually, and recreate the corrupt object from a recent backup, or from scratch.

Finally, be sure that your Office and Windows installations are fully up to date.
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 41779622
If the form has no records, the OnCurrent event will not fire.

/gustav
0
 
LVL 57
ID: 41779630
In the VBA editor, click tools, options.

On the general tab, make sure your set for "Break on Unhandled Errors".

/Decompile is what will probably straighten it out though.

Jim.
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 41779634
BTW, in later versions, the database options "Allow Access Special Keys" also turns off break points.

Jim.
0
 

Author Closing Comment

by:Fritz Paul
ID: 41779672
Thanks, that worked. You guys are great!
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

735 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