How to perform field on user input action in subform

How to perform field on user input action in subform

I have a form, Data, that has a subform, Calculation.  In the Calculation subform, there are 4 fields, Component (lookup), Concentration (decimal), Unit (dropdown), and Concentration in Percent (percent). The goal is to convert the concentration in the unit selected to % using the Unit as the On User Input trigger.  For example, the user selects the component, type 1000 in Concentration, then selects "ppm" from the Unit (dropdown) field, the script should run and output "0.1000%".  I can make this work in the subform directly, but I can't seem to make it work through the form.  I know the script has to be executed from the Data form, but I don't know how to get started.