onchange moving to wrong record

  • Thread starter Thread starter Ray Gurganus
  • Start date Start date
R

Ray Gurganus

I have an Access 2000 front-end with a SQL Server 2000 backend. On some
records, but not on all records, when editing through the form something
weird happens. I place the cursor into a field. For debugging, I added an
OnEnter event to check the ID number of the record - all is well. Then I
type something into the field. The OnChange event fires, and I check the ID
number of the record again - now it's on a completely different number. :(

The form itself doesn't show any change, I didn't do anything in the form to
instruct it to go to another record, no VBA code running that says to go to
another record, and the OnCurrent event doesn't fire, which would if the
code were moving it to another record, and yet it is on another record when
I have it print out the field values. Then when saving the changes, they
are applied to the second record and not the original.

As this just started recently with no programming changes in recent history,
I'm leaning towards a backend issue. I re-indexed. I ran checks on the
table in question, and SQL returns everything a-ok. Same problem persists.

Suggestions?
 
Found a workaround for this problem, in case someone else needs it. It was
related to a combo search box that uses the recordset to reposition the
record, which itself is working fine and has been for a couple of years.
The problem that just started happening is that after choosing a name from a
dropdown, it displays the proper record but the Access counter at the bottom
was not within the proper context of the full recordset. My test record was
in the W's, and the counter was nearer the beginning of 30k records. So
when saving, it was saving to the wrong record.

The workaround I just added is in the open form event, it goes to the last
record and then back to the first. Then it's always aware of the full
recordset and saves properly.
 
Back
Top