4 Replies Latest reply on Sep 16, 2010 11:04 AM by LaRetta_1

    Remove Or Omit Terminated Records from Database

    GregChapman

      Title

      Remove Or Omit Terminated Records from Database

      Post

      Greetings,

      I'm certain I have missed this in the many hours of great tutorials I've watched over the past month and in the interest of keeping my sanity I thought I'd try the good people here. (But this is fun stuff!)

      I have database set up for our small school of approximately 100 students and all is going well.  I have a date field called "D.O.T." (Date of Termination)...When a date is entered in that field I'd like that record to be removed from the main database and exported(?) to another one called "Terminated".

      I am able to export to the "termination" database the found records of those students that have been terminated but then they are still listed in the main database(?).  Or do I focus on a way to simply keep those records hidden or omitted rather than sending them anywhere else?

      Thank you in advance for any help...

        • 1. Re: Remove Or Omit Terminated Records from Database
          philmodjunk

          I recommend keeping all the records in one file unless it can't possibly be avoided.

          Find requests can be set up that omit records that have a date in your DOT field.

          Example:

          To find all students whose last name starts with "C":

          Enter find mode
          Enter C* in the last name field
          Select New Request
          Enter an * in the DOT field
          Select the Omit option
          Perform the find.

          • 2. Re: Remove Or Omit Terminated Records from Database
            GregChapman

            Thanks Phil!

            Will this method stay permanent (the "terminated" records will always be omitted?) or will one need to perform this find each time the database is opened?

            Now to figure out the script that will do this automatically whenever a date is placed in the "D.O.T." field. 

            thanks again!

            • 3. Re: Remove Or Omit Terminated Records from Database
              philmodjunk

              You can write a script like this:

              Enter Find Mode[]
              Set Field [Yourtable::DOTfield ; "*"]
              Omit Record//this is the same as clicking the omit option in a manual find
              Set Error Capture [on]
              Perform Find[]

              You can set this script to run when the file is opened or you can use an OnLayoutLoad script trigger to have this script be performed each time you select a specific layout.

              • 4. Re: Remove Or Omit Terminated Records from Database
                LaRetta_1

                Even if you constrict your file to omit DOTs when you open the file, you will lose that ability every time your Users perform a find.  You need to control all finds (which you should do anyway).  The best protection is to let them find what they want and add a Constrain at the end of it, something like:

                Enter Find Mode [ Pause ] ... user enters all criteria and multiple find requests all they want ...
                Perform Find [ ]
                Constrain Found Set [ Restore ; DOT field ; criteria = ]

                BTW, it is easier to search for blank DOT (using equal sign) than to search for DOT with something in it (*) and then having to omit.