Link to home
Start Free TrialLog in
Avatar of Patrick O'Dea
Patrick O'DeaFlag for Ireland

asked on

Corrupt Access Form

I had a corrupt Access form.
I managed to retrieve the form but am curious about the corruption.

Symptoms of Corruption:
1. Cannot even copy & paste for. (Access closes down).
2. Can go into "edit" mode but crashes if I may certain edits.

Why do forms go corrupt?
Is it something "nasty" that I put into the form?
How can I stop this happening again?
Is it my fault ?


I do NOT need to fix my form.  I am looking for more theoretical background causes.
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
...Sometimes certain Active X controls.
...Opening and closing the DB in rapid succession
In other words, ...there is no one root cause for all corruption...

Without going into the inner workings of how an Access DB is structured or how it is accessed, ...
An Access database is an entirely different animal than an Excel file or Word Document, so it is more prone to what commonly manifests itself as "corruption"

Jeff
"21Dewsbury"
Did this form have vba code?

Another source of Form corruption ... (with code) is ... copying the Form to a new name, then maybe deleting the original and other variations of this.  Whenever I do these kinds of things, I do a quick C&R between the operations.  I have definitely seen this result in form corruption.

mx
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Patrick O'Dea

ASKER

mx,

In answer to your questions ...

(Your comments are interesting..!)

Yes the form had VBA and also I may well have "renamed" the form and/or imported the form from a backup of the database.



Whereas the items in the Allen Browne KB are certainly true, most are not Form specific.  I can guarantee you for sure that after 19+ years now, I've seen many odd things happen with Forms ... especially involving copying/renaming/deleting ... in various combinations.  That's why I do a C&R between each op.  It's *soooo* easy to do.

mx
Yeah, I probably do C&R a lot more that I do Save.

I don't mind loosing a few design changes (if I forget to save)
...But I'd hate to loose the entire DB if I don C&R...
:-O

I do it as a fast way to restart the DB after changing an option, and I get all the other benefits as well...
boaq2000,

What exactly do you mean by
I do it as a fast way to restart the DB after changing an option, and I get all the other benefits as well...
<Whereas the items in the Allen Browne KB are certainly true, most are not Form specific. >

They may not be 'Form specific", but they certainly can lead to corruption in forms as well as data and should be a consideration in preventing DB corruption in addition to code or other issues within a form.

A couple of other issues that I have seen lead to Front-End/Form Corruption -

- Abnormal termination of digitally signing your VBA code (such as developer impatience/ aborting the signing process).  This can corrupt a form's code module or the entire project.

- I have seen a couple of forms corrupt which have empty event handlers in the code.  I have heard others say that empty event handlers can lead to form corruption, but don't have any other references backing that up.

On a side note, we had a start-up form in one of our databases that kept on corrupting every few months (simply couldn't open it in any view).  We'd re-import a seemingly 'good' copy of it to fix the issue and it would corrupt again a couple of months later.  There was nothing I could pinpoint that was wrong with this form based on anything I found researching it - everything posted this far in this thread was tried and/or or ruled out.  I finally recreated the form from scratch, and we haven't seen the problem in a couple of years now.  I think boag2000's aliens (http:#a37003400) may have been at fault in that case :)



SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<boaq2000, What exactly do you mean by...>

Whenever you change most Access Options, it require a restart of the database (Close the DB, then Re-open the db) for the changes to go into effect.
As part of what it does, C&R does this automatically

Then I get all the other benefits of C&R (Restructure the DB, Cleanup, re-index, ...etc)

Basically my post was in support of MX's post.

When it comes to C&R, ...Just Do It...

It can never hurt, but it will almost always help.

I'll give you an example.
Every once in a while, when I have my Access option set to "Tabbed Documents"
I will encounter a situation where clicking on the "X" simply wont close the form.
Without missing a beat, and almost without thinking about it, I instinctively do C&R, and ...Problem solved..
;-)

So at the first sign of something going "Wonky" (anything odd happening with the DB) I just do C&R.

Jeff
Folks , the message seem to be loud and clear - plenty of C&R.

A final comment/query.

I have a database with about 20 tables (mostly fairly empty).

My C&R only takes about 1 second which gives the impression that not much is happening??
Is this unusually short ??

Perhaps it is because I do not have many records.?
"Is this unusually short ??"
No.  In general, C&R is VERY fast.

Again, I cannot stress C&R enough as the #1 preventative maintenance, pre emptive strike, pro active measure toward minimizing corruption in an Access db.  And of course, ALL of the other items mentioned are equally as important.  With over 25 dbs  (BE's on a server, FE's local) in daily use by multiple users over a super high speed, super stable WAN ... in 4 years there has been virtually no BE corruption. All BE's are backed up and C&R'd nightly.

mx
Remember, just like defragmenting your hard drive regularly will reduce the time it takes to defragment,
...so does doing C&R regularly.

If I rake the leaves outside my house every day, it takes me 15 minutes, and my property always looks neat.
 ...If I do it once a week, it takes an hour, and my property looks pretty shabby by Friday night...

Make sense?...
;-)

Jeff
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks to all for contributions.

A wealthy of information and plenty to think about.