Hi all! and THANK YOU for your help!
Can someone please assist in making these codes to work? The command buttons are located in the Form footer section. When I run any one of the buttons, I get this:
"Compile error: Method or data member not found."
showing the error to be in the Private Sub Form_Current() section at all the "[...]enabled" lines.
(PS: after this works, I would like to add the "page of page" section of the Navigation Bar.)
Code:
Private Sub CmdFirst_Click()On Error Resume Next
DoCmd.GoToRecord , , acFirst
End Sub
Private Sub CmdNext_Click()
On Error Resume Next
DoCmd.GoToRecord , , acNext
End Sub
Private Sub CmdLast_Click()
On Error Resume Next
DoCmd.GoToRecord , , acLast
End Sub
Private Sub CmdNew_Click()
On Error Resume Next
DoCmd.GoToRecord , , acNew
End Sub
Private Sub CmdBack_Click()
On Error Resume Next
DoCmd.GoToRecord , , acPrevious
End Sub
Private Sub Form_Current()
On Error Resume Next
If Me.CurrentRecord = 1 Then
Me.CmdBack.Enabled = False
Me.CmdFirst.Enabled = False
Else
Me.CmdBack.Enabled = True
Me.CmdFirst.Enabled = True
End If
If Me.CurrentRecord = Me.Recordset.RecordCount Then
Me.cmdLast.Enabled = False
Else
Me.cmdLast.Enabled = True
End If
If Me.CurrentRecord >= Me.Recordset.RecordCount Then
Me.CmdNext.Enabled = False
Else
Me.CmdNext.Enabled = True
End If
If Me.NewRecord Then
Me.CmdNew.Enabled = False
Else
Me.CmdNew.Enabled = True
End If
End Sub