Lou, you need to do the backup, compact, decompile, compact, compact,
compile sequence again whenever this occurs. Presumably you still have the
other stuff set up correctly, so that sequence will fix it.
The problem is that Access maintains 2 copies of the code:
- the text version (what you see and edit), and
- the compiled version (code the machine can run.)
These 2 can get out of sync, so that what's running is not the same as what
you see.
One symptom of this kind of corruption is that it does not stop at
breakpoints you insert in code, or that it still stops on breakpoints you
have removed from the code. Other symptoms include execution of code that
you have deleted (e.g. a MsgBox is displayed with a message that is no
longer in the text version at all.) Sometimes it just gives errors such as
"Bad DLL Calling Convention." And sometimes it just crashes (shut down by
Windows) for no obvious reason.
Causes of this kind of corruption include the Compile on Demand option,
editing while in break mode (i.e. while the form is running, without first
switching to design mode), and editing under multiple versions of Access
(since each version generates its own compiled code binary.)
It is actually very common during development. I decompile at least every
other day when working heavily on a project, typically after making the
end-of-day backup, or as soon as there is any hint of a possible corruption
of this sort. It's point number 6 in this article:
Preventing corruption
at:
http://allenbrowne.com/ser-25.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<lg********@gmail.comwrote in message
news:11*********************@w3g2000hsg.googlegrou ps.com...
On Sep 12, 9:55 pm, lgeastw...@gmail.com wrote:
>On Sep 12, 8:18 pm, "Allen Browne" <AllenBro...@SeeSig.Invalidwrote:
Lou, this problem can occur in all versions of Access.
A decompile usually fixes it.
Try this sequence as a way to fix it now and reduce the chance of it
recurring:
1. Uncheck the boxes under:
Office Button | Access Options | Current Database | Name
AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
2. Compact the database to get rid of this junk:
Office Button | Manage | Compact/Repair
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 (holding down the Shift key if you have any startup
code),
and compact again.
5. Open a code window.
Choose Options on the Tools menu.
On the General tab, make sure Error Trapping is set to:
Break on Unhandled Errors
and the Compile on Demand is unchecked.
6. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<lgeastw...@gmail.comwrote in message
>news:11**********************@57g2000hsv.googlegr oups.com...
>I have a weird problem in Access 2007.
I've been working in A07 for about 2 weeks when this thing began
occurring.
I'm working in the VB Code Editor and set break points for event
procedures.
The weird thing is sometime the code breaks and sometimes it doesn't
at the very same spot.
Does someone know if this is a bug in A07?
I'm stumped
Lou
Allan
This seems to have helped
Thanks
Yikes it's back!
Curiously when I followed the steps to decompile I noticed that "Name
AutoCorrect" was not checked and "Break on Unhandled Errors" was
selected. But I decompiled anyway and it seemed to work.
But the weird behavior is back.
I wonder if any of the following conditions could be causing this?
I eagerly (wrongly) installed the free runtime A07 and ADE before
obtaining and installing the full A07 pro.
So now I have two instances of the program installed in separate
folders.
I converted my A97 app to A07 complete with custom menus.
In addition to A07 I still have A97 as well as A03 on my developing
machine.
As I read through the various posts on this topic I learned I was
committing the cardinal sin of developing while logged in as an
administrator.
So I created a (WinXP pro OS) user account to develop my app in.
But the problem of events not firing or breaking persisted.
I've also created a new database and imported all the db objects
(except custom menus).
This produced other problems which I suspect are related to the A97
custom menus..?
Any other ideas for solving the issues? One post suggested a stand
alone development machine..?
Thanks again
Lou