SOLVED

DoCmd.GoToRecord , , acLast

Steel Contributor

Hello, how can I go modify the below to go to the next to last record?  For example, if the last record was 10, I would want to go to 9.  I put a -1 at the end but that didnt work. 

 

Private Sub Form_Load()

       DoCmd.GoToRecord , , acLast
End Sub

 

thank you

2 Replies
best response confirmed by Tony2021 (Steel Contributor)
Solution

@Tony2021 

 

You could try

 

Private Sub Form_Load()

       DoCmd.GoToRecord , , acLast

       Docmd.GoToRecord ,, acPrevious
End Sub

 

ahh... perfect. thank you!
1 best response

Accepted Solutions
best response confirmed by Tony2021 (Steel Contributor)
Solution

@Tony2021 

 

You could try

 

Private Sub Form_Load()

       DoCmd.GoToRecord , , acLast

       Docmd.GoToRecord ,, acPrevious
End Sub

 

View solution in original post