Forum Discussion

Tony2021's avatar
Tony2021
Steel Contributor
Sep 30, 2022
Solved

DoCmd.GoToRecord , , acLast

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

  • Tony2021 

     

    You could try

     

    Private Sub Form_Load()

           DoCmd.GoToRecord , , acLast

           Docmd.GoToRecord ,, acPrevious
    End Sub

     

  • George_Hepworth's avatar
    George_Hepworth
    Silver Contributor

    Tony2021 

     

    You could try

     

    Private Sub Form_Load()

           DoCmd.GoToRecord , , acLast

           Docmd.GoToRecord ,, acPrevious
    End Sub

     

Resources