Solved

Access 2007 lost all forms and modules

Posted on 2009-04-08
5
552 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

726 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