Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Go to Last record (Access 2000)

    I am looking for a way to set the last record of the table to have the field session as True.My table is called exams,and the records contain the StudentNumber.
    I imagine by clicking the command to go to the last record and set the field session to True.
    How can i do it with the command Go to the last record ?

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

    Re: Go to Last record (Access 2000)

    What is "the last record of the table"? Records in an Access table do not have an intrinsic sort order. Do you mean the last record if sorted by examdate (assuming that this is the same table as in <post#=459460>post 459460</post#>)? (What if there are multiple records with the same examdate?)

  3. #3
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Go to Last record (Access 2000)

    The field StudentNumber is an Autonumber therefore it is unique.I want to go to the last record and there to set this StudentNumber to have
    the session as True.
    Thank you in advance

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

    Re: Go to Last record (Access 2000)

    You can use an update query with a nested query to select the highest StudentNumber. The SQL for this query looks like this:

    UPDATE Exams SET Session = True WHERE StudentNumber = (SELECT Max(StudentNumber) FROM Exams)

  5. #5
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Go to Last record (Access 2000)

    Super ! really a nice solution. Thanks

Posting Permissions

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