Update main form's Lookup value following the completion of a Subform within that same main form

Update main form's Lookup value following the completion of a Subform within that same main form

Hi,

It's quite a simple request but I'm struggling with getting the deluge to work smoothly.

In short, I have a main form (Place_New_Order). Public users will be able to use it.

They have a subform to complete with their contact details etc (name, email, phone, address) in this main form. The subform (CustomerSF) is a sub of another main form, 'Add_Customer.'

In the backend, I have a lookup to this same 'Add_Customer' field - this is what's visible when internal staff use the tool, as opposed to the subform. 

(Might not be the most efficient, but long story short, based on whether the form is completed by internal staff, or public, different fields are shown. Lookup is used for internal staff, subform is used for external public.)

In order for the completion of the main form to run smoothly (due to several workflows holding everything together), I need it so that the completion of the subform for Add_Customer, will:

(1) Compare the email address from the subform completion and see if a 'Customer' record already exists for it; 
(2a) If yes, just update the lookup to the relevant 'Customer' record inside the main form.
(2b) If no, create a new Customer record, and input that into the lookup field (all within the main Place_New_Order form.)

I'm sure this should be doable, but please let me know if what I'm asking is impossible.