With Access 97 on Windows 2000 I encountered the following problem more
than once in the same database. I used Find to search for text in form
modules and "search current database" so several form modules are opened
as the search proceeds. I then do additonal searches for different text.
Sometimes I close all the forms and module windows before proceeding with
a new text search, sometimes not.
The problem is that after doing these searches and then attempting to use
the database, I get a compile error -- "Expected Function or variable"
pointing to one of the FORMS! statements. I did not modify any text in
the modules during the searches. The modules previously compiled and the
database had been working just fine. Does anyone know why this happens?
Does opening several modules while searching for text corrupt the
database? It doesn't always happen after doing multiple text searches. I
have no idea how to fix it or prevent it. I have even tried running
Repair, but to no avail. I had to resort to backup copies.
This is an example of what the compiler identifies as the source of the
error:
FORMS!frmSELECT_ORDER.ORDER_ID
This is just one example. The same error occurs if other menu options in
the database are run and data from some other form is referenced. The
modules will no longer compile.