Solved

Access 2007 lost all forms and modules

Posted on 2009-04-08
5
547 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
<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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

771 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

12 Experts available now in Live!

Get 1:1 Help Now