AnsweredAssumed Answered

If Statement Add / Subtract

Question asked by Annette on Dec 2, 2013
Latest reply on Dec 2, 2013 by philmodjunk


If Statement Add / Subtract



     I have two Tables, we will call 1 and 2.  They are related by Table 1PK to the Table 1FK in Table 2.

     I have a count field on table 1, which I have set to when a record is created it automatically set to 0.

     On a layout based on table 1, I have a portal for table 2 with a button that will run a script.  I want the script to basically do the following.

     If field1 says Assessment and date field is greater than the current date add 1 to the count field in table 1

     if field1 says assessment, the date is either today or earlier and field 3 says DNA then subtract 1 from the count field in table 1

     If field 1 says Treatment and the date is greater than current date add 1 to the count field in table 1


     Clearly I'm doing something wrong when writing the statement because it is not subtracting the 1 when needed. 

     Thanks for the help!