2 Replies Latest reply on Feb 10, 2009 11:07 AM by DonorTracker

    script to change found set based on date range?

    DonorTracker

      Title

      script to change found set based on date range?

      Post

      Question from noobie Bento graduate:

       

      I was pleased at how easy it was to have FMPro-10 import my Bento checkbook register Library into a new FM database, complete with a decent layout (or two).

       

      I've since improved this by creating a new List layout. This is far better than Table View in Bento, since fields can use more than a single line in FM Lists.

       

      But to get to my question ... I'd like to make a script that changes the found set in my List layout based on a date range. I'd like to enter the start date and end date into two fields in the footer of the List layout, press a button, and have the contents of body part of the List reflect a new found set.  Ideally the starting point would be the complete set of records, even when a (partial) found set is currently in view.  My Table currently has a Date field.

       

      Could someone give a succinct set of steps to do this?  Or point me to a thread where this question has already been answered?  Thanks!

        • 1. Re: script to change found set based on date range?
          ninja
            

          Howdy DonorTacker,

           

          You want a find that has an assembled criteria in the field.  You want to search for "1/1/09...2/1/09" in the date field.

           

          The script would be (please forgive misspells):

          Enter Find Mode

          Setfield [Table1:: Date;Table2::Start_Date & "..." & Table2::End_Date]

          Perform find

           

          the '&'s assemble the search criteria right into the field and the "..." gives you the date range.

           Is that what you're after?

          • 2. Re: script to change found set based on date range?
            DonorTracker
              

            Ninja wrote:

            Howdy DonorTacker,

             

            You want a find that has an assembled criteria in the field.  You want to search for "1/1/09...2/1/09" in the date field.

             

            The script would be (please forgive misspells):

            Enter Find Mode

            Setfield [Table1:: Date;Table2::Start_Date & "..." & Table2::End_Date]

            Perform find

             

            the '&'s assemble the search criteria right into the field and the "..." gives you the date range.

             Is that what you're after?


            How do I enter the ;Table2::Start_Date & "..." & Table2::End_Date

            into the script editor? Set Field only allows me one field. 

             

            Update: OK, I get the syntax now. The stuff after the semi-colon gets entered into the calculation option, but without the semi-colon, which FM puts in by itself.