How to make pop up form dependent on subform row user entry

How to make pop up form dependent on subform row user entry

I currently have a product selection on my user form which has two options (box of 12 and box of 6). When one of these is selected I have a pop up form appear which relates to the option selected by the user, triggered when they select the product.

However, when a new row is added to the subform and another product selected, the subform only looks at the first row to determine which pop up form to load, not the current row that the product is being selected for.

How do I make the subform check for the value on the latest row being entered?

Support suggested I change the trigger to 'addition of row' from 'user input of field', but that doesn't help at all as the same problem occurs but with trigger being when I add an empty row, not fill in the latest one.

My current code is this:

for each  eachRow in Itemised
{
if(input.Itemised.Product.Product_Name == "Box of 12")
{
openUrl(" #Form:FlavoursSubform12","popup window");
}
else if(input.Itemised.Product.Product_Name == "Box of 6")
{
openUrl(" #Form:FlavoursSubform6","popup window");
}
}

Thanks in advance.