Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 547
  • Last Modified:

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.
0
Patrick O'Dea
Asked:
Patrick O'Dea
  • 6
  • 5
  • 4
  • +2
5 Solutions
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"Why do forms go corrupt?"
Yes ... especially if they contain VBA code.  Sometimes a bogus SQL Recordsource could be a problem.

"Is it something "nasty" that I put into the form?"
Not likely.

"How can I stop this happening again?"
Had to say.  Frequent Compact & Repair, and occasional Decompile.

Is it my fault ?
Not likely.

mx
0
 
Jeffrey CoachmanCommented:
1. Unexpected shutdowns (crashes, ...etc)
2. Not running the compact/repair utility regularly
3. Not compiling the code regularly
4. Aliens?
0
 
Jeffrey CoachmanCommented:
...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
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"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
0
 
mbizupCommented:
A shared user interface (Front End) even between a couple of users is a common and leading cause.  Any shared access db should have seperate data and user interface files, with the shared data (back end) residing on a network and the user interfaces (front ends) on each individual's computer.

Other leading causes are listed here:
http://allenbrowne.com/ser-25.html
0
 
Patrick O'DeaAuthor Commented:
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.



0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
0
 
Jeffrey CoachmanCommented:
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...
0
 
Patrick O'DeaAuthor Commented:
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...
0
 
mbizupCommented:
<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 :)



0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:


  Other thing I don't see mentioned is keeping your windows and Office installs up to date.  Most don't bother to do so.

Jim.
0
 
Jeffrey CoachmanCommented:
<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
0
 
Patrick O'DeaAuthor Commented:
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.?
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"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
0
 
Jeffrey CoachmanCommented:
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
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
LOL !!
0
 
Patrick O'DeaAuthor Commented:
Thanks to all for contributions.

A wealthy of information and plenty to think about.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
You are welcome ...

mx
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 6
  • 5
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now