Map fields from module X to a lookup field in subform in module Y

Map fields from module X to a lookup field in subform in module Y

Hi there

In the 1st screenshot attached, you can see a subform in myLeads module. You can see that there is a number already filled there - that is the 'Property ID' and it is a single line field. It is the 'Property ID' of an entry I have in another module - The 'Properties' module - take a look at the 2nd screenshot. In this second attached image, you can see the fields 'Property code' - this is basically the number that is mapped in the 'Property ID' field in the subform in the Leads layout. We also have the 'Property name' field. Both of these are once again single line fields.

What needs to be accomplished here is that in the Leads module, Property Interest subform, specifically the 'Property name' field next to the 'Property ID' field, needs to be mapped / populated with the corresponding Property name. For example, in the case, the Property name according to the Property ID - is the one that is shown in the second screenshot, under the name "Studio in Athens, Greece".

Important note however, the 'Property name' field inside the subform, is a Lookup field. 

So I would really appreciate some assistance in terms of writing a function that will automatically execute once the Property ID field is not empty - to then populate the right Property name in the lookup field discussed accordingly. The name shall remain as a lookup field and it's very important to stay so. 

Thank you