2 Replies Latest reply on Mar 1, 2009 7:47 AM by rshepherd

    Need a script to add one total to another

    rshepherd

      Title

      Need a script to add one total to another

      Post

      I am trying to create a very simple inventory file. I have a field where an operator will type in an amount. I want to create a script that will take that amount and add it to the amount in another field. Then delete the amount in the first field.

       

      For example:

      One field named "Cartons on Hand" has a number of 10

      User adds a number 5 into field called "New Cartons Received"

      Script will take amount in "New Cartons Received" which is 5 and add that to the number in "Cartons on Hand" which is 10 and will change the number to 15.

      Then "New Cartons Received" will be reset to empty.

       

      Can anybody give me help setting this up? I am using Filemaker version 5.5 

        • 1. Re: Need a script to add one total to another
          johnhorner
            

          hi rsheperd,

           

          i am not familiar with 5.5 but i can tell you how i would do it using the current version and i think it is uncomplicated enought that it  may work with 5.5.  i would do it using the "setfield" script step.  it would look something like this:

           

          setfield [cartons on hand ; cartons on hand + new cartons received]

          setfield [new cartons received; "0"]

           

          let me know if you don't have the setfield option available and there are two other methods i can explain which you can use and one of them involves nothing more than using the copy and paste script steps which i am all but certain are available in 5.5.

           

          keep me posted,

           

          john h.

          • 2. Re: Need a script to add one total to another
            rshepherd
              

            John,

             

            This is exactly what I needed. I know version 5.5 is ancient, but it's what I have and it does what we need.

             

            Thanks so much!!!!!!