Display record with most recent date

  • Thread starter Thread starter Ivor Williams
  • Start date Start date
I

Ivor Williams

I have a form with a subform. On the form is a text box in which I want to
display the value from a text box on the subform. I want this value to be
based on which record has the most recent date. How can I do this?

Ivor
 
Presumably there is some kind of relation between the main form's table and
the subform's table. One solution would be to use a DMax() expression that
looks up the highest date value in the field of the subform's table.

For example, if the main form contains clients, and the subform orders, and
you want the most recent order date for the client in the main form, the
text box would contain something like this:
=DMax("OrderDate", "tblOrder", "ClientID = " & Nz([ClientID],0))
 
Back
Top