Can't open source - Microsoft Access had encountered a problem and needs to close

I am running Access 2003 on XP 2002 SP2. Something wierd is happening. I have an ADP file that I have been working with for several years. Just today, when I attempt to open any module or form source code. I get an error: "Microsoft Office Access has encountered a problem and needs to close ...". It continually does this, even after reboot. I can do no work at all. What is going on? How do I get around this?

This is fairly urgent because 1099 tax forms need to be printed out of this system by tomorrow!!!
LVL 1
jmarkfoleyAsked:
Who is Participating?
 
Computer101Connect With a Mentor Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0
 
tonydemarcoCommented:
Try holding down the shift key while opening the file.
Then go to tools database utilities "compact repair"
0
 
jmarkfoleyAuthor Commented:
Compact Repair did not work; still gave me the error message and termianted whenever I tried to open any source. But I did get it working. Here's what I did: The last thing I did before this started happening was to make a minor VBA code change to a module (in fact, very minor - I just changed the contents of a string used in a query). I reasoned that there must be something wrong with this module. So, I opened up a new database and did a cut on the module in the misbehaving database and pasted it into the new database. In the new database I was finally able to open the module source code. I copied the VBA code and pasted it to a notepad txt. I then closed everything and opened the original database (now missing this module). I created a new module and simply pasted the contents of my paste bufferinto this new module. I saved and renamed the module to the original name and, voila! problem gone. I am able to compile to an ADE and open all sources again. I have no idea what the problem was. I made no changes to the module source. Who knows!
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Try the full procedure below:

A **DeCompile** may help here ...

But first, if you have not already:
Check for any **Missing References via the VBA Editor>>Tools>>References ....

Then, follow this procedure:

0) **Backup your MDB**
1) Compact and Repair the MDB, as follows:
Hold down the Shift key and open the MDB, then from the menu >>Tools>>Database Utilities>>Compact and Repair ...
2) Execute the Decompile (See example syntax below) >> after which, your database will reopen.
3) Close the mdb
4) Open the mdb and do a Compact and Repair (#1 above).
5) Open the mdb:
    a) Right click over a 'blank' area of the database window (container) and select Visual Basic Editor. A new window will open with the title 'Microsoft Visual Basic' ... followed by then name of your MDB.
    b) From the VBA Editor Menu at the top of the window:
       >>Debug>>Compile
        Note ... after the word Compile ...you will see the name of your 'Project' - just an fyi.

6) Close the mdb
7) Compact and Repair one more time.

*** Executing the DeCompile **EXAMPLE**:
Here is an example of the command line syntax  (be SURE to adjust your path and file name accordingly) for executing the decompile:

Run this from Start>>Run, enter the following command line - **all on one line** - it may appear like two lines here in the post:

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile "C:\Access2003Clients\AzDoc\Pgrm\AzDocPgrm2K3.mdb"

For more detail on the Decompile subject ... visit the Master on the subject (and other great stuff) Michael Kaplan:

http://www.trigeminal.com/usenet/usenet004.asp?1033

mx
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Before doing any more work on this database, I'd strongly encourage you to move your objects to a new database container. Even though it's "fixed", you obviously have some issues with the vba container.

Open Access, then open a new, blank database. Import all your objects from the problem db. Remake you references, if necessary, then compact and repair this one. Make a copy of this new database, then go back to development.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
And if you make a new MDB, then run the full Decompile procedure.

mx
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.