My On Current event to update the "Record X of Y" is
Expand|Select|Wrap|Line Numbers
- Private Sub Form_Current()
- Dim frm As Form, LastRec As Long
- Set frm = Forms!ReviewSearchRecordsForm
- If Trim(frm!txtRecordNo & "") = "" Then
- Me.RecordsetClone.MoveLast
- DoEvents
- End If
- LastRec = Me.RecordsetClone.RecordCount
- If Me.NewRecord Then LastRec = LastRec + 1
- frm!txtRecordNo = "Record " & CStr(Me.CurrentRecord) & " of " & CStr(LastRec)
- Set frm = Nothing
- End Sub
Expand|Select|Wrap|Line Numbers
- With Recordset
- If .AbsolutePosition = .RecordCount - 1 Then
- DoCmd.GoToRecord , , acFirst
- Else
- DoCmd.GoToRecord , , acNext
- End If
- End With
- Dim CurrentKey As Integer
- CurrentKey = [ID]
- Me.Requery
- Me.Recordset.FindFirst "[Id] = " & CurrentKey
On the form that isn't working, if you were on Record 4 of 10 and updated the record, after the requery it would state Record 4 of 4 (or 3 of 3 w/ previous). Navigating to another record will then cause the box to update correctly, i.e. Record 5 of 9 when you go to next.
The code is the same on all of the forms. The Enabled and Locked properties are set to Yes on all forms.
Does anyone have any idea what else I should check to determine why one of the forms in not updating properly when the others are?
Thanks in advance for your help!