Strange behavior when clicking a button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a button that performs a file import using VBA code. When
first opening the application and clicking the "Import" button, the code
stops at a line of the procedure even though there is no break point. After
pressing F5, code proceeds as expected until completion. If we reopen the
form, the import behaves normally (no stopping in code). Several days later
if we repeat the opening of the form and execution of Import, the same
behavior occurs: First time: stops at line in code; additional times, normal
behavior.

The funny thing is that on two different computers, the code stops at
different lines with the line being repeatable on each computer. Computer #1
stops at a line that begins with "On Error". Computer #2 stops at a line
that begins with "Me.lblMessage.Caption = ". This behavior makes no sense to
me. Has anyone else experienced this behavior and have any ideas about
avoiding it. End user does not find this behavior funny.
 
Yes, this behavior is symptomic of a corruption--the kind this is fixed with
a decompile.

Steps:
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.
 
Back
Top