Save Form, Get "Module Not Found"

M

Marlene

I am supporting a customer with a Microsoft Access 97 database
originally developed by a developer no longer with the company. I'll
spare you the background and jump right into my problem. When the
database is opened, it starts with a Main Menu form and from that form
goes to another one and onto a third when a selection from the 2nd
form's listbox is made and a command button called Go is pressed. This
third form is not listed as one of the db's Forms objects in the
database window, as are the first and second. When I enter design mode
on this form and try to save it with the option "within the current
database" I get a Module Not Found error. Same thing when I try the
other option, "to an external file or database". I have no idea what
module Access is referring to. Also, when I create a new database and
import from this one, this questionable/ third form is not listed as
one of the forms in the database. What can be causing this form to act
like a phantom? My ultimate goal is to import it into a new database so
I can convert to Access 2003. But this has me at a dead end in my
conversion process. Thanks to anyone who can shed some light!
 
A

Allen Browne

Hi Marlene

Sounds like a corruption issue. Try this sequence:

1. Start by making a backup of the mdb so you get multiple shots at
repairing it. It must not be open while copying the file.

2. Then run a repair (Tools | Database Utilities) to get rid of anything
Access can't make sense of.

3. Next, 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.

5. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

6. Still in the code window, choose Compile All And Save from the Debug
menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the phantom module is gone,
the indexes are repaired, inconsistencies between the text- and
compiled-versions of the code are fixed, reference ambiguities are resolved,
and the code syntax is compilable.


You may find that you have lost the code for a particular module in this
process. If you do, you at least know what it is called. You might even be
able to go back to the backup (made at step 1), open the module, copy all
the code out to Notepad, create a new module in the new database, and paste
the code in.
 
M

Marlene via AccessMonster.com

Thanks. I wasn't sure a decompile would work (because the db had never been
compiled?), and I was having a permissions/exclusive error trying to run the
/decompile (even though it's just me working on my home computer (but the db
did come from a client)) which would have taken me a long time to get around,
so what I did, since I was lucky enough to have the form in front of my own
eyes, was just create a new form and set it property-by-property to the
values of the phantom form. Then I saved the form as the same name of the
phantom form and imported it into the db that wasn't working. (Funny how
there was no name conflict in the db I imported it into?) It was a very
simple solution, though I am troubled by what really caused the error.

Thanks for your well-thought out response.
 
Top