How do I filter a subform lookup based on a main form lookup?

How do I filter a subform lookup based on a main form lookup?

We represent multiple vendors as commissioned sales reps.  We track our sales by entering them on a Purchase Orders tracking form.  One of the fields on the main form is Vendor, a lookup from the Vendors table. 

The form has a subform to select the Product sold, and enter the cost and order quantity.   The subform field Product is a lookup from the Products table.  I would like to limit the list of Products in the dropdown to only those sold by the Vendor that was selected on the main form.  I can't figure out how to do this.  I tried creating an On User Input variable on the main form after selecting Vendor.  But when I try to set that as a filter on the subform I get the message "variable Temp.Vendor not defined." 

Any help would be appreciated.  Sorry if this has been solved before; I see where a number of people have asked this question in the past, but I don't see the answer to this specific question. 

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now