Populating fields with data from related different forms

Populating fields with data from related different forms

OK Here is an issue that I have tried to simplify:

My application has 2 forms 
  • MAIN
  • DATA
MAIN which has 2 fields
  • MainSalesPerson - LOOKUP (linked to DataSalesPerson).
  • MainEmail - Fetch data from the DATA FORM

DATA which has 2 fields
  • DataSalesPerson - TEXT INPUT
  • DataEmail - TEXT INPUT

In MAIN, on user selection of MainSalesPerson, I want to fetch the corresponding email from the DATA form field DataEmail and display it in the MAIN Form field - "MainEmail".

I cannot seem to understand how to get this to work with a simple deluge script - Please advise

Jonathan