Access 2007 lost all forms and modules

I was running Access 2003 and 2007 together, getting code from one and pasting to the other. I changed a form name in 2007 and saved, then got the message that VBA modules had been corrupted. I saved a backup but now find that my forms have no module code and won't won't import to a new accdb  file . My stand-alone modules are also visible but can't be accessed or imported into another database.
jeffkwells2003Asked:
Who is Participating?
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
<This doesn't work at all in 2007.>

That's not entirely accurate. It does work in 2007, but depending on the level of corruption, you may not be able to recover. Of course, that has always been the case with Access.

Glad to know of your experience with EverythingAccess. I've heard good things about them.
0
 
rockiroadsCommented:
I dunno if a decompile helps here. Sounds like a badly corrupted db.

Have u tried the normal compact/repair? Give a decompile an option
http://allenbrowne.com/ser-47.html
Ive not tried it in A2007, it works fine for A2003, give it a go. Always backup everything you do though

eg specify proper path of msaccess, and specify path of database
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile "c:\mydb.accdb"

0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I'd bet the issue stemmed from running 2003 and 2007 together, at the same time. I tried this a few times back when 2007 first came out and had disastrous results each time - one of the instances would freeze, or I'd have extremely poor performance as one tried to "re-register" itself when I switched between the two. The fix is pretty simple - just say NO to running them both together. If you need to move code, Export it to Text (there is an option when you're viewing the code module to do this) or just Import everything to a new 2007 db and use THAT when rebuilding. Even MS suggests that you NOT run both 2007 and <any other Access version> on the same machine at the same time.

I'd bet your db is hopelessly corrupted, but you may be able to use rocki's suggestion and things straight. If you cannot, you can try using the undocumented SaveAsText and LoadFromText methods. From the Immediate window:

SaveAsText(acForm, "YourFormName", "PathToSave.txt")

Now delete that form, then run this:

LoadFromText(acForm, "YourFormName", "PathWhereSaved.txt")

I doubt it'll work, but this saved my bacon just two weeks ago when I could no longer open a Form.
0
 
rockiroadsCommented:
Scott, since you have experience of upgrading, can you have a look here please. I checked the queries and they seem fine, no aggregate function use so might be something wrong with the report, I dunno.  http://www.experts-exchange.com/Database/Miscellaneous/Q_24297666.html - thanks!
0
 
jeffkwells2003Author Commented:
Thanks for the suggestions everyone. I already knew that Access 2007 was 'uncomfortable' with 2003 but I didn't realise how catastrophic it could be. Whenever a 2003 application got corrupted in the past it was usually rescuable by creating a new .mdb file and importing most of the old stuff into the new database. This doesn't work at all in 2007.

In the end I found an answer to a previous question here where someone suggested EverythingAccess.com. Brilliant.  Their Wayne Philips was very helpful, looked at the corrupt accdb file I sent him, told me what he could do (recover all of my VBA code) and how much it would cost. I was back in business within an hour and a half of contacting the company. Excellent service. Highly recommended.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.