Using dynamic lookup fields in subforms

Using dynamic lookup fields in subforms

I figured out how to do this on a regular form, but then I had the "brilliant" idea to make it have a subform so that more than one item could be ordered.  It isn't working though.  I would appreciate any help.  I am anxious to learn Creator and seeing all that it can do.

So, i created two new forms.

salesTemplate - The subform with the lookup fields on it
salesTemplate2 - The form that the subform will be on.

The code I wrote for a regular form is this:

  1. //Set Price field
  2. newprice  =  Products  [ID == input.Product];
  3. input.Price = newprice.Price;
  4. //Get tax info if applicable
  5. getproduct  =  Products  [ID == input.Product];
  6. if (getproduct.Taxed)
  7. {
  8.     input.Tax = (input.Price  *  0.07);
  9. }
  10. else
  11. {
  12.     input.Tax = 0;
  13. }
  14. //Get Total Cost
  15. if (input.Tax  >  0)
  16. {
  17.     input.Total = (input.Price  +  input.Tax);
  18. }
  19. else
  20. {
  21.     input.Total = input.Price;
  22. }

I'm not really understanding why this isn't working.  I haven't changed any field names, so shouldn't it still work?   I don't get any errors - it just doesn't insert the price, tax and total into the boxes.

Thanks for any help.