4 Replies Latest reply on May 16, 2010 1:05 AM by Lioncross

    Search Form for Multiple Products Tables



      Search Form for Multiple Products Tables


      Hi ,


      I have a question here.

      1.How do I create a Products Search Form for Multiple Product tables (more than 1 table)?




        • 1. Re: Search Form for Multiple Products Tables

          You usually shouldn't have multiple product tables but rather one table with field to designate why the products are different, such as Type and/or Category.

          • 2. Re: Search Form for Multiple Products Tables

            Well it is like I have a Computer Products and Cosmetics Product and it has different fields on it , like Computer Products has Serial Number , Cosmetics product has a  custom measurement like g (gram) or mL (milliliter) 

            Is it possible to have a Search Form for the multiple tables ? TYB

            • 3. Re: Search Form for Multiple Products Tables

              If the products are so different, couldn't a person tell whether they wanted to find a computer or a cosmetic?  You could put two global text fields - one called gComputers and the other called gCosmetics.  User would enter the search term then click button to fire script (or use script trigger on field exit of:


              If [ IsEmpty ( gComputer ) and IsEmpty ( gCosmetics ) ]

              Show Custom Dialog [ OK ; You must enter a value ]

              Halt Script

              End If

              Freeze Window

              If [ not IsEmpty (gComputer ]

              Go To Layout [layout based upon computers ]

              Enter Find Mode [ ]

              Set Field [ your computer field ;  "*" & gComputer & "*" ]

              Set Error Capture [ On ]

              Perform Find [ ]

              ... put your error trapping here


              Go To Layout [ layout based upon Cosmetics ]

              same as above for computer

              End If


              But in truth ... the fact that you want to search both indicates that it might work better if they were together.  Empty fields are cheap real estate.  Nobody says you must have something in every field but it would depend upon how many fields.  Some developers split; some keep together.  I prefer together particularly if I get a hint that they may EVER need to be together for reports or searching.  :smileyhappy:


              UPDATE: Otherwise you can use one global and switch to one table, search and if no results, switch to the other table and search.  However, if the User enters part of a phrase, it might find it in computers when they were looking for cosmetics.

              • 4. Re: Search Form for Multiple Products Tables

                Hi Laretta, Thanks for the idea. I will try it ... thanks

                And Im just learning this File Maker ... Usually did on excel (Manually)