Access Has Stopped Working

Hello, i am using ms access 2010 on windows 7.  I am building a application that includes many procedures.  the db is only 15 megs so far.  For some reason when I try to include additional script in any one of my procedures I get the error "Microsoft Has Stopped Working" and then it restarts.  It's as if it can't handle anymore script.  So far i have compacted and repaired the db, updated my Windows, installed Office service pak 1 and compiled it successfully and I'm still having the problem.  Any help would be greatly appreciated.  Thanks.
Who is Participating?
ilfocorpConnect With a Mentor Author Commented:
Ok. I resolved the problem thanks to all of the above "process of eliminations".  It was to many lines of script in the module.

The limit I was running into is 65535 lines of code in 1 module.
I was able to create a workaround where I moved some of the code into a new module.  This allowed the new code to paste in without Access crashing.

Code Limitations

Thank you all for the support.
chubby_informerConnect With a Mentor Commented:
uninstall office using

Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
Do other databases have troubles, or only this one? If it's only this one, you might try moving everything into a new, blank database. This can clean up container corruption.

If that doesn't work, then as chubby_informer suggests, you may need to uninstall and reinstall Office.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Jim Dettman (Microsoft MVP/ EE MVE)Connect With a Mentor President / OwnerCommented:
<<For some reason when I try to include additional script in any one of my procedures I get the error "Microsoft Has Stopped Working" and then it restarts. >>

From your description, it's hard to say what exactly is going on.   It may be that you have some corruption in the VBA project file of the DB. Try importing everything to a clean DB as LSM suggests and see if that clears it up.

 Be aware however that bugs in Access itself will cause the same thing, so I'd make sure your up to date on service packs as well.

 Last, as LSM asked; are you having any other problems?  Hardware (such as a bad memory module) can cause faults as well.

 To pin this down a little more, you'd have to give us some more detail about when this happens, other DB's giving you issues, other programs, this just started, always been this way, etc.

  What has been suggested so far is just the most common causes and are really just shots in the dark more or less.

Jeffrey CoachmanConnect With a Mentor MIS LiasonCommented:
< For some reason when I try to include additional script in any one of my procedures I get the error "Microsoft Has Stopped Working" and then it restarts. >

Meaning the database was working fine, then when you added one "Particular" piece of code, you got this error?

Try unloading all the code, then adding each sub in, one at a time, until you get the error.
At least you will know where the problem code is...

ilfocorpAuthor Commented:
In addition to compacting and repairing the db (.accdb), updating my Windows and installing Office service pak 1 I did try importing the tables, queries and form (including the subs) into a clean db and the problem persist.  I tried opening the DB (.accdb) and adding additional script on another computer with office 2010 installed and got the same problem. I may try uninstalling and reinstalling the office suite and see if that fixes.  Thanks.

Jeffrey CoachmanMIS LiasonCommented:
If it is the code that is the issue, then importing faulty code into a new database will yield the same issue.

This is why I suggested NOT importing the code.
Then adding in one sub at at a time until the issue appears.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You might also try performing maintenance on the database, as this can often pinpoint where the problem is.

First, make a backup, then do this:

1. Compact the db
2. Compile the db -- from the VBA Editor click Debug - Compile. Fix any errors, and continue doing this until the menuitem is disabled
3. Compact again

Now move everything into a new, blank container. As Jeff indicates, if you have a problem with a particular piece of code, then do NOT move that into your new db.

Now try running the db. If it works, then import the last piece of code. If that causes the new db to fail, then you've found the culprit - you'll have to recreate that bit of code manually.

Also, sometimes a Decompile may help. You do this BEFORE the 3 steps above:

Build a shortcut with this as the target:

"full path to msaccess.exe" "full path to your db" /decompile

Run this shortcut, the perform the 3 steps + import again.
ilfocorpAuthor Commented:
My solution was the actual solution.  But I appreciate all the support that help me get to it.
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.