Move To Last Record
acCmdRecordsGoToLast
This code moves the cursor to the last record. It is designed to run behind a button called cmdLast.
'***************** Code Start *******************
' This code was originally written by Terry Wickenden.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
Private Sub cmdLast_Click()
On Error GoTo ErrLast
DoCmd.RunCommand acCmdRecordsGoToLast
Exit Sub
ErrLast:
Select Case Err
Case 2046
'Command not available
MsgBox "You are already on the last record." , vbInformation, "Not Available"
Case Else
MsgBox Err.Number & ":-" & vbCrLf & Err.Description
End Select
End Sub
'****************** Code End ********************