Form Corruption in Access 2003

G

Guest

I have a form with 4 subforms and plenty of assorted objects on it. The form
works great until (a user found this feature and I can recreate it) the user
selects a text box and sorts the form via that data item. At this point, I
believe the form is corrupted. The user can edit data from records that
exist, but when the user attempts to add a new records we get one of those
famous "Microsoft Office Access has encountered a problem...." and shuts
down. I can then import that form from a backup and everything works well
until the sort occurs again.

Also, it doesn't matter if the user closes the form and reopens it before
trying to add another records, it still closes access with the problem
report. Interesting enough, the actually record will exist in the table with
the data that was input before the corrupted form closes.

My bag of tricks has reached empty. Thanks!

Rich
 
M

M Skabialka

I have highlighted and renamed the form in the designer window and done a
copy/paste, giving the new one the original name, which for some unknown
reason sometimes eliminates corruption. If there are no problems, delete
the original to get possible junk out of the database. Do the same if you
suspect one of the subforms.
Then there's always the undocumented decompile, e.g.
msaccess.exe /decompile "C:\MyDatabase.mdb"
followed by recompiling your code after reopening a code module.

Of course make a copy of the dB first - no matter what you do!
Mich
 
G

Guest

Thanks Mich,
I'll try the decompile, I have forgotten whether or not I've tried that on
this database.

Reimporting the subforms might help too. Since just reimporting the main
form seemed to have been the fix, I didn't continue with importing the subs.
 
D

d

Google for "Access has encountered a problem" (with quotes) and you'll
get over 4000 hits.

Most will recommend copying all objects from the old .mdb to a new
one. Note: this does not take care of database properties, such as
title or icon -- nor does it copy any VBA references. Make sure you
recompile the VBA code. Compact and Repair when done. If it blows up
on Compact and Repair, just try it again. The internal Compact and
Repair command gets confused quite often.

See http://www.granite.ab.ca/access/corruptmdbs.htm and
http://allenbrowne.com/ser-25.html and
http://allenbrowne.com/ser-47.html

I have written an Access program that simply renames the original .mdb
to .old, and uses

DBEngine.CompactDatabase strOld, strMDB

to compact and repair .old into .new. It never, ever blows up and
seems to slow down this type of error. Make sure to recompile the VBA
code.

Access 2003 can blow up by copying a control to the clipboard and then
pasting it back on the form. Sometimes it waits a few seconds before
throwing all your work away.

"Access has encountered a problem" means that it is a problem that is
not handled by Access. There is no chance to save your work when the
message appears. So chuck away copies all day long. If you don't
want to lose more than 30 minutes of work, save a copy each 30
minutes. This error is not limited to Access, but it seems more
horrible when it happens in Access.

Good luck!
 
M

M Skabialka

I have highlighted and renamed the form in the designer window and done a
copy/paste, giving the new one the original name, which for some unknown
reason sometimes eliminates corruption. If there are no problems, delete
the original to get possible junk out of the database. Do the same if you
suspect one of the subforms.
Then there's always the undocumented decompile, e.g.
msaccess.exe /decompile "C:\MyDatabase.mdb"
followed by recompiling your code after reopening a code module.

Of course make a copy of the dB first - no matter what you do!
Mich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top