Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open form on the last entry (Access 2000)

    My form is based on the table Enrollment. The last record is Enrollment ID = 128 What command could i give in order to open a form in a columnar view based on the last record ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Open form on the last entry (Access 2000)

    One option is to create a query based on the Enrollment table that sorts the records on Enrollment ID in descending order, and use this query as record source for the form.

    Another option is to move to the last record using code in the On Load event of the form:

    Private Sub Form_Load()
    RunCommand acCmdRecordsGoToLast
    End Sub

  3. #3
    Star Lounger
    Join Date
    Sep 2002
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open form on the last entry (Access 2000)

    Thank FriendI ! was not successful with using the code to go to the last record,since it that case i coudnt edit in the form.Sorting in descending order was all right with me,but it was awkard to edit because of the presence of the previous Enrollments.Could i use some filter on the last record, to show on the form only the records on the last enrollment, or make the previous records invisible?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Open form on the last entry (Access 2000)

    There is no reason why using

    RunCommand acCmdRevordsGoToLast

    would prevent editing. There must be some other reason for that.

    If you want to display only the last enrollment, you could create a query whose SQL looks like this (the exact names might be different):
    <code>
    SELECT *
    FROM Enrollment
    WHERE [EnrollmentID] = (SELECT Max([EnrollmentID]) FROM Enrollment)</code>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •