In the attached image a query can be seen. If we take the record "Depreciation" as an example. The first record has a fromdate021 of 01Jan2018. The Todate021a is a write able field and Todate021b is a calculated field. The expression currently in Todate021b is Todate021b: IIf([Todate021a] Is Null,Now()+60,[Todate021a]) Record POL0004 is the second record for Depreciation. The first record has a Todate021b of 31 Dec 2018, that date was captured. It means when the user registered record POL0004 he needed to go back to record POL0001 to capture the date. If a business changes its policy on the depreciation rate more times than twice, there will be multiple such records.
I am trying to find an expression, maybe combining with the expression in Todate021b that will automatically set the Todate in record POL0001 when POL0004 is created. When POL0004 is created I want the user not needing to go back to capture 31Dec2018 manually. If there are multiple records for depreciation the expression will have to find the latest one, and if the fromdate021 in the new record is 01Jan2019, it mist display 31Dec2018 in Todate021b of record POL0001.