Opening Form to Last Record

  • Thread starter Thread starter Bob
  • Start date Start date
In the Open Event of the Form, you can use the GoToRecord Method to make the
last Record the Current Record on your Form.

Check Access VB Help on the GoToRecord Method.
 
Try the following on your form's open event. The If test prevents a runtime
error when there are no records in the form. Also, this assumes that the
form's recordset is already sorted accordingly.

Private Sub Form_Open(Cancel As Integer)
If Not (Me.Recordset.EOF And Me.Recordset.BOF) Then
Me.Recordset.MoveLast
End If
End Sub
 
The suggestions from the others will work but remember that the last record
will be based on the sorting option you have for your table or query.
Either suggestion will move to the last item in the list. If you're trying
to move to the last entry added, you'll need to do more.

Kelvin
 
Back
Top