G
Guest
I have a continuous form with 2 fields, ID and sortOrder. The
Form_AfterUpdate code does a requery to re-sort the fields (the underlying
recordset is sorted by sortOrder). After the requery I want to position to
the record that was modified. Here's the AfterUpdate code:
Me.Requery
Me.RecordsetClone.FindFirst "ID = " & Me.ID
Me.Bookmark = Me.RecordsetClone.Bookmark
The value for ID in the event handler is correct (it's for the changed
record) but setting Me.Bookmark does not cause positiioning to that record;
it remains in the original spot.
For example: let's say there are 3 records in the form (col1=ID,
col2=sortOrder):
A 1
B 2
C 3
If I change the sortOrder for B from 2 to 4 this is what I see after the
requery:
A 1
C 3
B 4
This is correct, but the focus stays on the 2nd row (C 3) and I want it to
be on the 3rd row (B 4), the record that was changed.
Thanks - Dana
Form_AfterUpdate code does a requery to re-sort the fields (the underlying
recordset is sorted by sortOrder). After the requery I want to position to
the record that was modified. Here's the AfterUpdate code:
Me.Requery
Me.RecordsetClone.FindFirst "ID = " & Me.ID
Me.Bookmark = Me.RecordsetClone.Bookmark
The value for ID in the event handler is correct (it's for the changed
record) but setting Me.Bookmark does not cause positiioning to that record;
it remains in the original spot.
For example: let's say there are 3 records in the form (col1=ID,
col2=sortOrder):
A 1
B 2
C 3
If I change the sortOrder for B from 2 to 4 this is what I see after the
requery:
A 1
C 3
B 4
This is correct, but the focus stays on the 2nd row (C 3) and I want it to
be on the 3rd row (B 4), the record that was changed.
Thanks - Dana