greater date from a column in a subform to a form field

D

devastator442

Hello,

I have a subform with a date column inside. This subform can have multiple
records. I would like to pull the latest date from that column in the
subform and place it in a MaintenanceRenewal field on my main form. How can
I accomplish this?

Thanks
 
A

Allen Browne

Don't store the value. Just use a calculated field

The Control Source of your text box will be something like this:
=DMax("MaintenanceDate", "MySubTable", "FKID = " & Nz([MainID],0))

where:
- "MySubTable" is the name of the subform's table;
- "MainID" is the name of the main form's primary key field;
- "FKID is the name of the matching foreign key field in the subform's
table.
 
Top