how the access report shows only the last record in the table ??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mostafa moniem
    New Member
    • Apr 2016
    • 18

    how the access report shows only the last record in the table ??

    i want to make a report shows only the last record in the table.. when i open the report it open all the records >>
    what can i do ??
    could anybody help ??
    thanks :*
  • mbizup
    New Member
    • Jun 2015
    • 80

    #2
    Assuming you have an Autocount ID/Primary Key field or some other way of indicating the order in which the records were entered, you can use a TOP 1 query, with a descending sort order to return the last record as the RecordSource of your report:

    Code:
    SELECT TOP 1 * FROM YOUR TABLE ORDER BY ID DESC

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      It might be better to have the code pass the last record primary key to the report as WHERE condition by using the form's recordset property, movelast, take the primary key of that record and pass it to the report.

      Comment

      Working...