How to get data selected in subform onSuccess

How to get data selected in subform onSuccess

Hey,

I'm trying to get the products and quantity selected in a subform and put them in a map.

Here are my forms:

Form 1: OrderForm:
Fields:
      1.Name (Single_Field)
      2. Products (Subform - Form 2)

Form 2: ProductsForm
Fields:
      1.Product Name (Dropdown Lookup Field to Form 3)
      2.Quantity (Single_Field)

Form 3: Items (Here is where I insert the products into the system, the user is not able to see this form)
Fields:
      1.Item Name (Single_Field)

On submit in the OrderForm, I want to fetch the Name, and all the Products and Quantities the user inserted and put them in a map. I'm really new to this, so I'm still getting a feel for this. Here is what I have so far:
  1. myMap = Map();
  2. ThisOrder  =  Untitled_Form  [ID == ID];
  3. TheProducts = ThisOrder.Products;
  4. for each val in TheProducts
  5. {
  6.     myMap.put(val.Product1); //Product1 is the name of the ProductName field
  7. }
  8. info result;

The info is showing null. Can someone help?