• How to go to last record in a continuous form (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » How to go to last record in a continuous form (Access 2000)

    Author
    Topic
    #410246

    I have a button on a form that opens my frmNewFees form. When it opens it shows a continuous form of all the fees that are already entered. Is there any way to get it to go to the last record or a new record when the form opens? That way my users don’t have to scroll down a long list of fees before they can enter a new fee.

    Viewing 2 reply threads
    Author
    Replies
    • #880195

      In the on load event of the form use :
      Private Sub Form_Load()
      DoCmd.GoToRecord acDataForm, Me.Name, acLast
      End Sub

    • #880224

      Sorry, I’ve read the post not completely.
      For a new record use in the on load event of the form:
      Private Sub Form_Load()
      DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
      End Sub

      • #880266

        Thanks, Francois. It works great.

      • #880267

        Thanks, Francois. It works great.

      • #886302

        In the DoCmd statement “Me.Name” is a refference to what?

        • #886343

          In the code behind a form, Me refers to the instance of the form that is running the code. So instead of referring to Forms!frmNewFees, you can refer to Me. Much shorter and easier. In the instruction Francois posted, Me.Name is the name of the form. He could have used “frmNewFees”, but that would cause an error if you decide to rename the form, while Me.Name stays valid.

          Similarly, in the code behind a report, Me refers to the instance of the report that is running the code.

        • #886344

          In the code behind a form, Me refers to the instance of the form that is running the code. So instead of referring to Forms!frmNewFees, you can refer to Me. Much shorter and easier. In the instruction Francois posted, Me.Name is the name of the form. He could have used “frmNewFees”, but that would cause an error if you decide to rename the form, while Me.Name stays valid.

          Similarly, in the code behind a report, Me refers to the instance of the report that is running the code.

      • #886303

        In the DoCmd statement “Me.Name” is a refference to what?

    • #880225

      Sorry, I’ve read the post not completely.
      For a new record use in the on load event of the form:
      Private Sub Form_Load()
      DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
      End Sub

    Viewing 2 reply threads
    Reply To: How to go to last record in a continuous form (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: