?
Solved

Access 2007 lost all forms and modules

Posted on 2009-04-08
5
Medium Priority
?
554 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 85
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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

801 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