J
Jeefgeorge
I have a subform with custom navigation controls including a current / total
record text boxes. When the main form loads, the total record on the subform
is 1. If I manually navigate to the last record on the subform, then go back
to the first record, the total record shows correctly. However if the main
form record changes, the total on the subform resets to 1. I have opened the
subform without the main form and the total text box shows the correct
number. I cannot figure out why this text box doesn't show the correct total
with the main form.
Code for the subform:
Private Sub Form_Current()
On Error GoTo Err_Current
Dim First As String
'Populate the Record of Records used for Navigation
With Me.RecordsetClone
If Not .EOF Then .MoveLast
Me.Current = Me.CurrentRecord
End With
If Me.Current.Value > Me.RecordsetClone.RecordCount Then
Me.Total = "of " & Me.RecordsetClone.RecordCount + 1
Else
Me.Total = "of " & Me.RecordsetClone.RecordCount
End If
record text boxes. When the main form loads, the total record on the subform
is 1. If I manually navigate to the last record on the subform, then go back
to the first record, the total record shows correctly. However if the main
form record changes, the total on the subform resets to 1. I have opened the
subform without the main form and the total text box shows the correct
number. I cannot figure out why this text box doesn't show the correct total
with the main form.
Code for the subform:
Private Sub Form_Current()
On Error GoTo Err_Current
Dim First As String
'Populate the Record of Records used for Navigation
With Me.RecordsetClone
If Not .EOF Then .MoveLast
Me.Current = Me.CurrentRecord
End With
If Me.Current.Value > Me.RecordsetClone.RecordCount Then
Me.Total = "of " & Me.RecordsetClone.RecordCount + 1
Else
Me.Total = "of " & Me.RecordsetClone.RecordCount
End If