I have a form with two subforms, one holds a clients details, the other the client's bookings, and this form compiles client details and bookings to make an invoice. Due to GDPR and my own sanity I am required to delete a clients details 4 years after their last booking, but they may have many invoices over a number of years. At the moment every time i create an invoice it updates a control on the client details subform to the last booking in that invoice (as below), is there a way to make it check which date comes last and keep that one? I've had a play with Iif but am just really struggling.
At the moment i have
Private Sub Booking_subform_Exit(Cancel As Integer)
[booking contact subform].[Form]![latest booking].Value = [booking subform].[Form]![Max DATE]
End Sub