2 Replies Latest reply on Mar 16, 2010 9:55 AM by slaglemark

    storing search criteria in a global text field?

    slaglemark

      Title

      storing search criteria in a global text field?

      Post

      hi, thanks for your time

       

      i would like a field in the header to display the fields that were searched by to obtain the found set.

       

      there is quite a lot of data on the layout, and, when searching and printing, it can become difficult to determine what you searched for later on.

       

      im told that the best way is to have the search criteria stored in a global text field, and place that in the header.

       

      i am unclear on how to accomplish this.

       

      any input would be appreciated.

       

      FMP 9A

      FMS 10A

      Mac os 10.5.8

       

      thx!

      -m

        • 1. Re: storing search criteria in a global text field?
          philmodjunk

          There isn't any one exact way to do this, but here's a general outline:

           

          Create a layout and place global fields on it that correspond with each field you might want to use in your search.

          Your users enter criteria and click a button on the layout to trigger a sript.

           

          Your script acts like this: (I'm using just one global search field, just add more set field steps for more search fields.)

           

          Go To Layout (//select your results layout)

          Enter Find mode []

          Set FIeld [YourTable::YourSearchField ; YourTable::gGlobalSearchField ]

          Set Error capture [on]

          Perform Find []

          //Add code here to process the results of your find. You can use get ( FoundCount ) to count the number of records and you can use get ( LastError ) to check for error conditions.

           

          Now you can just place the same global fields from your search layout into the header of your results layout to document the criteria specified in your search.

           

          Note: a completely different approach is to use Modify Last Find to return to find mode and display all the criteria used to perform your last find in the nonglobal fields where you entered your search criteria.

          • 2. Re: storing search criteria in a global text field?
            slaglemark

            this makes sense to me as i read it.

             

            let's see if i can execute!

             

            thanks very much for the reply.

            -m