Solved

Access 2007 lost all forms and modules

Posted on 2009-04-08
5
549 Views
Last Modified: 2013-11-29
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.
0
Comment
Question by:jeffkwells2003
  • 2
  • 2
5 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 24095686
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
 
LVL 84
ID: 24095755
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
 
LVL 65

Expert Comment

by:rockiroads
ID: 24095905
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
 

Author Comment

by:jeffkwells2003
ID: 24105780
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
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 24110360
<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

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now