Hi аll,
whenever I try to use this code and set Navigation Buttons to "No" (Property Sheet) it says record 1 of 1 no matter how many records there are and the nav buttons do not work.
What is wrong with the code and can it be made working?
whenever I try to use this code and set Navigation Buttons to "No" (Property Sheet) it says record 1 of 1 no matter how many records there are and the nav buttons do not work.
What is wrong with the code and can it be made working?
Code:
Private Sub Form_Current()
Me!txtResult = CurrentRecord & " of " & Me.RecordsetClone.RecordCount
Me.Caption = Me.txtResult
On Error Resume Next
' These If Statements manage the Navigation Buttons
If Me.CurrentRecord = 1 Then
Me.cmd_Back.Enabled = False
Me.cmd_First.Enabled = False
Else
Me.cmd_Back.Enabled = True
Me.cmd_First.Enabled = True
End If
If Me.CurrentRecord = Me.Recordset.RecordCount Then
Me.cmd_Last.Enabled = False
Else
Me.cmd_Last.Enabled = True
End If
If Me.CurrentRecord >= Me.Recordset.RecordCount Then
Me.cmd_Next.Enabled = False
Else
Me.cmd_Next.Enabled = True
End If
End Sub