Solved

Why does my Access VBA code not stop at breakpoint

Posted on 2016-09-01
5
116 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 85
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 58
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 58

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 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