4 Replies Latest reply on Jan 21, 2011 3:23 PM by philmodjunk

    setting up a find "after chosen date"



      setting up a find "after chosen date"


      I am sure that there is a simple answer and that i am being thick but i cant seem for the life of me to find the solution that works or explains it simply enough for me to get it to work.

      I have a series of records that has a finish date as a field.  I am trying to set up a layout such that i can chose a date using a drop down calendar and then find records with the finish date that occurs after the chosen date.  i can do this by using the find function on that particular layout but this is not how i want it to work.  My problem comes when trying to work out what field to use to define the search.

      Do i have to create a search date field on this table and then have the script run or can i use the finish date field to run this script?

      Many thanks

        • 1. Re: setting up a find "after chosen date"


          You can use the finish date field, but you'll need to trap for that date after which you are interested...

          If you set up a global field (gSearchDate), enter the date in there then run a script of the form:

          Enter Find Mode
          SetField [FinishDateField ; ">" & gSearchDate]
          Perform Find

          You should get what you describe.  The only reason the script is necessary at all is to get the < symbol into your find.  Note that you could also do this manually if you prefer...depends on how you would use this function, and who.  In find mode simply type in

          >1/31/2011 into the finish date field and hit enter

          Is this what you're after?

          • 2. Re: setting up a find "after chosen date"

            And a script trigger can be used to run this find automatically every time you select or enter a date in gSearchDate.

            • 3. Re: setting up a find "after chosen date"

              Thanks Ninja and Phil. This is exactly what i am after. I have tried to set up the search but it keeps coming up with an invalid criteria field set.

              Where do i set up the gSearchDate field?

              At the moment i have a layout to enter the requested date and a button to trigger the script.  Once the button is triggered it goes to the a list layout that i want but enters into find mode. If i press continue it just gives me the records unsorted.

              Thanks again

              • 4. Re: setting up a find "after chosen date"

                Make sure that gSearchDate is a field set up with global storage. This script will not work unless you do that. gSearchDate can be defined in any table in your database and sometimes I define a table just for global fields so I can better keep track of them.

                In your script, clear the pause check box so that the script does not pause while in find mode.