4 Replies Latest reply on Apr 28, 2009 7:15 PM by comment_1

    Logical treatment of checkbox statements in search.

    Phaelix

      Title

      Logical treatment of checkbox statements in search.

      Post

      I'm building a search form for my database, and I'm using checkboxes to simplify the process for less-savvy users.  These work great from a display and interface point of view, but the syntax for the checkboxes seems to be hard coded so that "X and Y and Z" must be true for an entry to return.  Is it possible to alter a checkbox field so that it searches for "X or Y or Z"?

       

      Any help would be much appreciated.

        • 1. Re: Logical treatment of checkbox statements in search.
          comment_1
            

          Phaelix wrote:

          Is it possible to alter a checkbox field so that it searches for "X or Y or Z"?


          No, but there are two alternatives you could use:

           

          1. Run a script that creates a new request for each checked value;

           

          2. Use a relationship and Go to Related Record [ Show only related records ] instead of a find.


          • 2. Re: Logical treatment of checkbox statements in search.
            philmodjunk
              

            With a check box field, comment's second suggestion can be especially elegant. Clicking check boxes in stores each selected value list item in the same field, separating them with carriage returns. Using such a field as the key in a relationship will match values in the related table if they match the first value OR the second value OR the third... Since this is exactly what you want, a GTRR can be a very simple way to pull up the matching records you want.

             

            Note that GTRR has a lot of options. Thus it's a good one to research in the on line help system. Note that if you use GTRR and specify a target layout with no matching values, GTRR will fail to switch to the target layout and will not update the found set as you expect. You thus have to test for the possibility that you have no matching records when you use this script step.

            • 3. Re: Logical treatment of checkbox statements in search.
              Phaelix
                

              Hi guys, thanks for the thoughtful replies, very informative.

               

                I've taken a couple of runs at getting this working using GTRR, but I'm finding some difficulties. Am I right to deduce that GTRR will only work from an existing record, and therefore won't take filled search fields from find mode and go from them?

               

                If not, it seems like I would have to give searchers edit permission, create a new dummy record for every search, perform GTRR on it, then delete it via script.  Is that accurate, or am I missing something?

               

                Thanks again for your time and patience.

              • 4. Re: Logical treatment of checkbox statements in search.
                comment_1
                  

                If you want to use GTRR instead of find, there's no reason to enter Find mode.

                 

                You certainly do not need (or want) dummy records - use a global field for user input, and define the relationship to match the global field to the "real" field.