Jaroslav Beran said:
... the /DECOMPILE switch solved my problem ...
I've never heard about this switch before - is this some
kind of black magic?
Access stores 2 versions of the code:
- the text version (what you view and edit),
- the compiled version (machine type code that actually runs).
Under certain conditions, it is possible for these to get out of sync, so
the compiled code no longer matches the text you are viewing, i.e. a
corruption has crept into the database. The Decompile switch instructs
Access to dump the compiled version. It can then recompile from the text,
and you are back in sync. Of course, if it was the text version that was
wrong, you're in trouble, so we always recommend backing up before
decompiling.
IME, editing the code in break mode is one of the causes of this kind of
corruption. When you modify an object, Access creates a temporary copy so
that you are able to revert to the previously saved object. At this point it
would appear that it is trying to manage 4 copies of the: text and compiled
of current form, and text and compiled of the temp form. If you are in break
mode at the point when it creates the temp copy, then at some point it seems
to get these copies confused, and the compiled code no longer matches the
text version. I cannot demonstrate that this what happens, but I think the
circumstantial evidence is strong.