Results 1 to 4 of 4
  1. #1
    clue74 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    2

    finding last record in a table/form

    Product Name Start Weight End Weight
    Product 1 379000 389000
    Product 2 288435 226710
    Product 3 699000 318882
    Product 4 36800 50000
    Product 5 89180 117280
    Product 6 132000 132000
    Product 7 18 18
    Product 1

    Product 2

    Product 3

    Product 4

    Product 5

    Product 6

    Product 7




  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    What are you using for your determination of what is the "last" record?
    Note that in Access, the relative position of a record in comparison to other records really has very little meaning (it is much different than Excel this way).
    In Access, when you refer to the last record, it usually means in reference to some other field (i.e. "latest date", "highest id number", etc.).

    If you want "last" mean the "latest entry added", you can add an AutoNumber field to your table, which begins at 1 and keeps incrementing every time a new record is added. Then this would give you a field which you could use to determine what the "last" record is (by taking the record with the Max Autonumber ID value).

  3. #3
    clue74 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2012
    Posts
    2
    Quote Originally Posted by JoeM View Post
    What are you using for your determination of what is the "last" record?
    Note that in Access, the relative position of a record in comparison to other records really has very little meaning (it is much different than Excel this way).
    In Access, when you refer to the last record, it usually means in reference to some other field (i.e. "latest date", "highest id number", etc.).

    If you want "last" mean the "latest entry added", you can add an AutoNumber field to your table, which begins at 1 and keeps incrementing every time a new record is added. Then this would give you a field which you could use to determine what the "last" record is (by taking the record with the Max Autonumber ID value).
    It would be the last entry added...How would you go about telling the form this information? I also need it to identify the 'last entry' by product code. So when the user is inputting into the form by date and product code, I would like the form to populate the start weight with the end weight for the last record added for the product code identified on the form. Thanks.

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I am not sure I follow exactly how you are trying to use this, but maybe these comments will help. If not, maybe you could walk throw an example or two based on the data sample your provided.

    You would base your form on an Aggregate Query that selected the "Max" or "Last" record using the methods I described in my previous post.
    Likewise, you may be able to use the DMAX or DLOOKUP functions.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Finding the Next record
    By rjbautista20 in forum Programming
    Replies: 15
    Last Post: 01-20-2012, 01:27 AM
  2. finding a record in a listbox
    By mgwat69 in forum Programming
    Replies: 2
    Last Post: 10-03-2011, 11:38 AM
  3. Finding table in form
    By Anne in forum Access
    Replies: 2
    Last Post: 09-22-2011, 01:56 AM
  4. Replies: 2
    Last Post: 06-20-2010, 06:54 PM
  5. Finding a record
    By Rick West in forum Forms
    Replies: 3
    Last Post: 06-14-2010, 06:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums