Writing the wrong record (Bookmark bug, old version)

        1 votes: *****     1,298 views      No comments
by Allen Browne, 20 April 2005    (for Access 97, 2000)

Flaws in Microsoft Access

Provided by Allen Browne

See the updated version of this article.

Bookmark Bug

Access can display a record on screen, but if you edit it, your changes overwrite another record! This bug applies to Access 2, 95, 97, and 2000.

The underlying cause is Access misinterpreting a form's bookmark after a record has been deleted. The Bookmark is the primary mechanism for finding a record in a form programmatically, e.g. Using a Combo Box to Find Records.

Steps to demonstrate the original bug:

  1. Open a form that has many hundreds of records.
  2. Delete one of the early records.
  3. Use RecordsetClone and Bookmark to move to a record more than 262 records further on.
  4. Edit the record and save your changes.

At step 3, Access shows on screen the record that you sought. However, the edits at step 4 are written to the following record. If two records are deleted at step 2, the edits are written to two records after the one shown on screen. Clearly Access is mismatching the form's bookmark.

Patch for Access 2000

The bug occurs in a somewhat different set of circumstances in Access 2000. Microsoft has released a hotfix for this version. See knowledgebase article Q238134

Patch for Access 97

The patch of Access 97 is included in Service Release 2. To guarantee you are not affected, take these steps:

  1. Choose About from the Help menu in Access 97. If Service Release 2 has been applied, the version will be displayed as "Access 97 SR-2".
  2. The Bookmark Bug has been seen on some systems with SR-2 installed, due to multiple copies of msjet35.dll. Typically SR-2 installs this file into %Windows%\System, but if Access is using a copy in a different location the bug is still present. Search your hard drive for msjet35.dll. If you find more than one file with this name, right-click them and choose Properties to determine which is the later version. The patched version should show at least 3.51.2026, preferably 3.51.2723. Delete the earlier version. Restart Access, and check your References: if the file is "MISSING", browse to the other location.

No patch is available for Access 2 or 95.

For Microsoft's information about this bug in Access 2, 95, and 97, see ACC: Data Changes Are Saved to the Incorrect Record.

Workaround for Access 2/95

Requerying the form before using RecordsetClone will prevent the problem. This workaround is unsatisfactory:

  • Requery can be a lengthy process, often increasing network traffic significantly.
  • Requery has other side effects. For example, it is necessary to locate the current record again, a process which usually involves RecordsetClone and Bookmark again.

Home Index of tips Top

Rate this article:  Your rating: PoorYour rating: Not so goodYour rating: AverageYour rating: GoodYour rating: Excellent

This is a cached tutorial, reproduced with permission.

Have your say - comment on this article.

What did you think of 'Writing the wrong record (Bookmark bug, old version)'?

No comments yet.

Why not be the first to comment on this article?!

Have your say...

E-mail (e-mail address will be kept private)

Comments require approval before being displayed on this page (allow 24 hours).