Access 2007 module corrupted

Associate
Joined
17 Jan 2016
Posts
2
I left an Access 2007 application open, and left my computer the next morning, the VBA module was corrupted. The message I get when I try to open the module, I get:

"The module name 'Module1' is misspelled or refers to a module that doesn't exist."

"If the invalid module name is in a macro, and Action Failed dialog box will display the macro name and the macro's arguments after you click OK. Open the Macro window, and enter the correct module name."
 
Soldato
Joined
25 Oct 2002
Posts
2,640
There was a thread a little while ago which had some suggestions of tools for recovering Access databases which may help here.

I guess an easy option would be to open a recent backup of your database and export the corrupted module, and then import back into the latest version. The risk with this is what else may have broken in your current database, it does seem strange to me that specifically a module alone would corrupt.
 
Associate
Joined
24 Jan 2016
Posts
2
If you can't do any of those things, then you may need to contact a repair service Access Recovery Toolbox. http://www.oemailrecovery.com/access_repair.html Is one often recommended.
BUT First: Make a copy of your corrupted database. Don't do anything with this copy.

Can you open the corrupted database? If so, then I'd first try to Decompile it. Build a shortcut on your desktop, and set the Target like this:

"full path to msaccess.exe" "Full path to your db" /decompile

After this completes, then try to open the database. If you can, then do this:

1) Compact the database - click the Office button - Manage - Compact
2) Compile the app - open the VB Editor (Alt + F11 will get you there), click Debug - Compile. Fix any errors, and compile again.
3) Compact again

Now see if your module can be opened. Chances are it can't. If so, then do this:

1) Build a new, blank database
2) Import everything to that new database
3) Compile the new db
4) Compact the new db

If none of this works, you may need to either recreate that module from scratch, or import it from a known good backup.
 
Back
Top Bottom