Access Crashing When View Code


I have an Access 97 Application and 1 of my forms seems to have become corrupted.  I can view the code module of all of the other forms but when I try to the view the code of the problem form, the application quits.  I tried to import the form into another DB and it won't do that either.  Any ideas?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jadedataMS Access Systems CreatorCommented:
Hey rthomsen!

  I hope you have an older copy of the form in a backup mdb.  It appears it is hopelessly corrupted.

rthomsenAuthor Commented:
Any idea how this may have occurred?
jadedataMS Access Systems CreatorCommented:
This is something Access developers get used to and plan for by maintaining a vigorous backup agenda.

I periodically (daily or better during development) import all Forms/Reports/Modules to a separate backup to keep the coded object backup.
A full backup is done regularly

During developement periods,...CRSCRSCRSCRS
 (compact repair SAVE compact repair SAVE compact repair SAVE compact repair SAVE)

The heavier I'm hammering code and object, the move often I run the backups.

Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

Try creating a new blank database and then importing all the stuff from the corrupted one
I had a similar problem recently.  My database has a few tables containing data which are updated and it was the modules that seemed to get corrupted.  The data tables seemed to be OK.  So I found an old back-up with working modules, deleted the data tables, and then copied the up-to-date data tables to the older database.

So if your case is similar, and you have an old backup with the form working OK, you can either follow my route or delete the corrupt from from the current database and then copy a working copy into the database. Maybe someone here has an oprinion as to the best route.   In either case a compact and repair is in order.

rthomsenAuthor Commented:
Ok...this is the weirdest thing ever.

Every time I clicked the code menu button or view->Code in the access menu, access would crash.

But...I right clicked on the form and selected Build Event.... and chose the Code Builder and I was able to gain access to the code and now everything seems to be fine.  I saved and did a compact and repair and now I'm going to create a backup.

Thanks for your suggestions.

jadedataMS Access Systems CreatorCommented:
Sometimes compiling the code will help you turn up something that is causing an error by reference. (gremblins)  A correction in a global procedure can resolve the issues and the crashing goes away.  (BUT BACKUP ANYWAYS AT THAT POINT>>>)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rthomsenAuthor Commented:
Even though It worked itself out, I just split the points between everyone who attempted to help.


jadedataMS Access Systems CreatorCommented:
But we let you know you are not alone in the world of database corruption!
I hope we all still provided a little extra to think about for the next occurrance.

thanx for the question!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.