Form crashes with error c0000005

B

Bob Howard

I have one particular form (of about 40 in the application) that will crash
Access about 50% of the time. The crash only occurs when the form closes.
None of the other forms exhibit this behavior. This form is opened by my
main form and runs on top of the main form (which stays open behind the form
that fails).

To close this bad guy, the user clicks a button on the failing form. This
button has an OnClick event. This event first sets a couple of values in
controls of the form that invoked the failing form, and then issues

"DoCmd.Close acForm, Me.Name, acSaveNo"

just like all my other forms.

Then I get a crash with error c0000005.

I've removed Office 2000 Pro and re-installed it --- no help.

I've started with a new empty database and imported everything from the old
database --- no help.

Any clues from here?

Bob (@Martureo.Org)
 
A

Allen Browne

A decompile might fix it, but first make sure Name AutoCorrect is off.

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access, and compact again.
 
B

Bob Howard

Thanks. I followed the instructions and decompiled. But the form crashed
Access on the first try! I'm real puzzled on this! Bob.
 
B

Bob Howard

I made a slight change and the problem appears to have gone away. Here's
how it used to work:

The same form is used for two purposes depending upon which buttoon on the
main form opens the offending form: 1) data entry; 2) browse and update.

The offending form is coded assuming browse and update mode, so it has
DataEntry=No and AllowAdditions=No set in its properties. In its Open
event, if it determines (based on an openarg) it has been called for data
entry mode, it sets those two properties to Yes (i.e., sets them true) and
modifies the properties or several controls on the form.

So I made the following change and it now appears to work OK:

I changed the assumption to dataentry mode, so it has DataEntry=Yes and
AllowAdditions=Yes set in its properties. In its Open event, if it
determines it has been called for browse and update mode, I set these two
properties to No (i.e., False).

I have no idea why this would have solved the problem. It seems like 6 or
one, and half dozen of the other. The coding accomplishes the exact same
thing.

But now it works!

I'll assume this is some strange Access 2000 bug.

Thanks for your help!

Bob.
 
Joined
May 9, 2012
Messages
2
Reaction score
0
guy, I searched for the ms-access appcrash solution for several days (windows 7 64 bits, ms-access xp 2002).

the solution was
make sure Name AutoCorrect is off.
>
> 1. Uncheck the boxes under:
> Tools | Options | General | Name AutoCorrect
> Explanation of why:
>
http://allenbrowne.com/bug-03.html
>

I never noticed this before.
Thanks so much.
 

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