Below is an example code that can be specified in the On User Input action of a subform picklist field.
list = Product [Category == row.Category] sort by Product_Code ;clear row.Items;row.Items:UI.append(itemlist.Product_Code.getall())