Hi all,
I need help with a custom navigation buttons.
When I go to the very first or very last record, there is a pop-up message "You can't go to the specific record."
How can I make it not showing anymore.
Below is the code. Thank you in advanced.
I need help with a custom navigation buttons.
When I go to the very first or very last record, there is a pop-up message "You can't go to the specific record."
How can I make it not showing anymore.
Below is the code. Thank you in advanced.
Code:
Private Sub cmdNextRecord_Click()
On Error GoTo Err_cmdNextRecord_Click
DoCmd.GoToRecord , , acNext
Me.cmdFirstRecord.Enabled = True
Me.cmdPreviousRecord.Enabled = True
Exit_cmdNextRecord_Click:
Exit Sub
Err_cmdNextRecord_Click:
MsgBox Err.Description
Resume Exit_cmdNextRecord_Click
End Sub
Private Sub cmdPreviousRecord_Click()
On Error GoTo Err_cmdPreviousRecord_Click
DoCmd.GoToRecord , , acPrevious
Me.cmdNextRecord.Enabled = True
Exit_cmdPreviousRecord_Click:
Exit Sub
Err_cmdPreviousRecord_Click:
MsgBox Err.Description
Resume Exit_cmdPreviousRecord_Click
End Sub