Bound form updates wrong record

  • Thread starter Thread starter Russ Ferrill
  • Start date Start date
R

Russ Ferrill

I have an old Access97 database with bound forms. I have a form on which
data modified in one particular text box gets updated to a different,
seemingly random, record. For example, I have record 12345 displayed. I
modify the data in the text box. I click Next. I click Prev to view the
modified record, but the modification is not there. The record is just as it
was before I changed the data. But, somewhere in the database is a record
that has the change I thought I was making to record 12345.

If I add lines to the Form.Load event to move to the last record and then
back to the first record, the form behaves as expected.

Has anybody heard of this behavior? Is this a bug or am I doing something
stupid? All suggestions are welcome.

Russ
 
Russ, what Service Pack do you have? Help | About should indicate if it's
"Access 97 SR-2" or not.

If you do not have SR-2, you have struck the Bookmark bug. See:
http://allenbrowne.com/BugBookmark.html

If you do have A97 SR-2, search your hard drive for the file msjet35.dll. If
you have multiple copies of this file, it is possible that the wrong one is
being accessed in memory. Right-click the file and choose Properties. On the
Version tab, confirm that you have at least 3.51.2026 (preferably 3.51.3328)

If none of this applies to you, please indicate whether the data is in
Access tables or is in linked tables from another source. Also, the
approximate number of records in this form.
 
I'm running Access 97 SR-2 and my msjet35.dll is version 3.51.3328. The
tables are linked to an Access 97 mdb that holds nothing but the data. The
query for the form returns 171383 records.
 
Russ, I do believe this is the bookmark bug.

To verify the bug, save the primary key value into a form-level variable in
Form_BeforeUpdate. Compare the variable to the primary key in
Form_AfterUpdate. If the two are ever different, you have a confirmed case
of the Bookmark bug. Further, you will find that the difference does match
the primary key of the wrongly updated record.

We logged the same behavior with a client who assured me they had the
correct A97 patch and version of jet. They were also loading a large number
of records (> 100k).

Instead of solving the problem, we worked around it by setting the
RecordSource of their form so it loaded just one record at a time. Access
will not write to the wrong record if there is only one loaded. It means
developing a different approach for navigating records. Instead of actually
navigating to another record, you load a different record by changing the
RecordSource of the form.

There is no solution for this bug AFAIK, so hopefully the workaround will
suffice.
 
Back
Top