workflow not working in subform

workflow not working in subform

I have the following code in a subform which works perfectly when i use the form alone but when i use the form as a subform within another main form it does not work. I have read something about using row but i just cant seem to figure out what to change in my existing code.

Basically there is a lookup fields fetching matching data into my form and populating some fields.

Subform is called = order item
mainform is called = order entry
data from = pms_md_variety

  1. Fet = pms_md_variety[ID == input.Variety_Name];
    input.order_items_var_supplier = Fet.var_md_supplier;
    input.order_items_var_department = Fet.var_md_department;
    input.order_items_var_price = Fet.var_md_price;
    input.order_items_var_colour = Fet.var_md_colour;
    input.order_items_var_botan = Fet.var_md_botan;
    input.order_items_var_royalty = Fet.var_md_royalty;
    input.order_items_var_group = Fet.var_md_group;
    input.Variety_Code1 = Fet.var_md_no;