Opening Form to Last Record

V

Van T. Dinh

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.
 
S

Sandra Daigle

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
 
K

Kelvin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top