Fatal error on navigation button click

  • Thread starter Thread starter Dean Slindee
  • Start date Start date
D

Dean Slindee

I am consistently getting an fatal abend when hitting the < navigation
button.

The application consists of one parent table and four child tables. They
are all presented on a single tab control with 6 tabs.
The parent row occupies the first two tabs. Tabs 3-6 each have one of the
child tables presented in a subform where the linkage is by a common
integer-type key column.

I have no problem scrolling thru the entire database using the > navigation
button. I can set focus onto one of the child form tabs and then hit >
again, no problem.

However if I set focus on one of the child form tabs and hit the <
navigation button, Access will fatally abend every time. Here is the
message I get: "The instruction at "0x30349382" referenced memory at
"0x00000068". The memory could not be "read".


Why is this occuring, or how can I possibly start to debug this abend?
Thanks
Dean Slindee
 
If this is Access 2002 or 2003, you have hit a very common bug. The
workaround is to add a text box to your subforms for the foreign key fields.

Open the main form in design view.
Right-click on the subform control, and choose Properties.
Look at the LinkChildFields property.
Add text boxes to your subform for any fields named in this property.
You don't have to show these text boxes, i.e. you can set their Visible
property to No.

Typically, the field is a foreign key, and you don't need to see it in your
subform, so you don't bother with a text box. The linked field is then an
object of undocumented type AccessField, and the bug seems to be associated
with this type. By placing a text box in the subform for the field, it
becomes part of the subform's Controls collection, and so is an object of
type TextBox instead of AccessField, so you avoid the bug.

After making this change in all of your subforms, there are a couple of
other things you can do to aid stability:
1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://members.iinet.net.au/~allenbrowne/bug-03.html

2. Compact to get rid of the Name AutoCorrect junk.

3. Decompile a copy of 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"
This is necessary to guarantee Access dumps the compiled code, and
re-evalulates the collections. Then compact again.

You should now have a stable database. For other suggestions on avoiding
corruption, see:
http://members.iinet.net.au/~allenbrowne/ser-25.html

BTW, it's also important to avoid using names in the
LinkMasterFields/LinkChildFields that could be mistaken for form properties,
such as Name, Section, Width, ...
 
Back
Top