Crash on Open Form/SubForm

  • Thread starter Thread starter Charles P. \(Pat\) Upshaw
  • Start date Start date
C

Charles P. \(Pat\) Upshaw

I have a form which contains a subform, which has worked for years. Every
once in a while when I open the form the database crashes.

I can open the form in design view then switch to form view OK. But if I
open the form directly or through my menu system it crashes.

In the past I would import the form/subform from a backup of the database
and this would fix the problem - for awhile.

Is there a way to find out what the problem is.

I get the dreaded "Microsoft Office Access has encountered a problem and
needs to close. We are sorry for the inconvenience." Repairing the
database has not helped. The error report does not help - ending with
"Path%%\197981.cvr"

This is very frustrating.

Thanks,
Pat Upshaw

I'm working in Access 2003. This never happened in Access97.
 
Could be a number of things, but this does sound like a problem I've
experienced in A2002 and A2003 that was not in previous versions.

The crash seems to relate to using the name of an object of type AccessField
in the LinkChildFields property of the subform control. It doesn't always
happen, but when it starts, it tends to persist. The workaround is to place
a text box in the subform for the field(s) named in LinkChildFields. Access
then treats it as a reference to a TextBox type object, which does not have
the flaw, and so the problem is gone.

Getting that to happen is a bit more involved though, as we also have to get
Access to recognise the change. Assuming that you don't already have a text
box in the subform for the foreign key field, try this sequence:

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. Open the subform in design view, and add the text box for the foreign key
field (the one named in LinkChildFields). Set its Visible property to No if
you wish. Save. Close.

4. Open the main form in design view, and delete the entries for
LinkChildField and LinkMasterFields. Make a code change to the main form's
module: anything, we just want to force it to compile again later. Save.
Close.

5. Compact the database again.

6. Open the main form in design view, and restore the entries for
LinkChildField and LinkMasterFields.

That should have it solved. If not follow the steps for typical corruption
recorvery: decompile, compact, create a new database and turn off Name
AutoCorrect, import everything.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

"Charles P. (Pat) Upshaw @bellsouth.net>" <patup<remove this> wrote in
message
 
Back
Top