Breakpoint not always working in Access 2003.

D

Don

Hello, I just upgraded an Access 97 application to Access 2003. In one
screen I've realize that my breakpoints aren't working. I know that the
code is getting to the breakpoint because I put a message box before and
after it. Also, in other parts of the application the code breaks at the
breakpoint. Anyone know why this might be?

Thanks

Don
 
A

Allen Browne

Hi Don

This is a fairly common kind of corruption, that occurs when the 2 copies of
the code that Access keeps get out of sync, so the text copy (what you see
and edit) no longer matches the compiled copy (what actually runs.) A
decompile fixes the problem by forcing Access to discard the compiled copy.
It then recreates the compiled code from the text, and so the 2 copies are
in sync again.

Try this sequence:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access, and compact again.

Please post a reply if the problem is still after those steps.

I personally believe that one of the triggers that causes this problem is
editing the code while the form is running (not in design view.) for other
suggestions on how to avoid corrupting your database, see:
Preventing corruption
at:
http://allenbrowne.com/ser-25.html
 
V

Van T. Dinh

I *think* another possibility is that you have unchecked the "Use Access
Special Keys" option in the Startup options ... IIRC, this will ignore the
breakpoints in VBA code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top