DLookup question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aidan
    New Member
    • Sep 2006
    • 10

    #1

    DLookup question

    I have a query that returns a list of records sorted by date/time descending.
    The first record in the query will be the most recent.

    In a form for data entry I want to select the values from the last instance of data entered using Dlookup to select the first record frm the above query, something like:

    DLookup("[Field]", "Query", criteria to select the first record from the query)

    Any ideas?

    Thanks
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    One option is to use :
    Code:
    DFirst('[Field]', 'Query')
    But if you prefer, you can use the TOP predicate in the SELECT clause of the query to return only the first record :
    Code:
    SELECT TOP 1 ...

    Comment

    Working...