Hi -
I tested the following code and it works great.
Original Term: IIf([Contract Not Expired]=0 And [Contract Details]![Renewal Term]="Original Term" And DateDiff("d",Date(),DateAdd("m",[Contract Details]![Term],[Service Details]![End Date]))>0,DateDiff("d",Date(),DateAdd("m",[Contract Details]![Term],[Service Details]![End Date])),IIf([Contract Not Expired]=0 And [Contract Details]![Renewal Term]="Original Term" And DateDiff("d",Date(),DateAdd("m",[Contract Details]![Term]*2,[Service Details]![End Date]))>0,DateDiff("d",Date(),DateAdd("m",[Contract Details]![Term]*2,[Service Details]![End Date])),IIf([Contract Not Expired]=0 And [Contract Details]![Renewal Term]="Original Term","ERROR",0)))
However I need to expand this querry to be able to handle up to 7 renewals, I've now created this code in notepad, see attached. I didn't format the attached code to make it easier to read because I wanted you to see it exactly as it is in the code builder.
When I paste the code into the expression builder and say ok, I don't get an error, but the new code isn't being saved. When I go back into the builder the original code is still there.
Any thoughts on why this is happening?
Thanks.
I tested the following code and it works great.
Original Term: IIf([Contract Not Expired]=0 And [Contract Details]![Renewal Term]="Original Term" And DateDiff("d",Date(),DateAdd("m",[Contract Details]![Term],[Service Details]![End Date]))>0,DateDiff("d",Date(),DateAdd("m",[Contract Details]![Term],[Service Details]![End Date])),IIf([Contract Not Expired]=0 And [Contract Details]![Renewal Term]="Original Term" And DateDiff("d",Date(),DateAdd("m",[Contract Details]![Term]*2,[Service Details]![End Date]))>0,DateDiff("d",Date(),DateAdd("m",[Contract Details]![Term]*2,[Service Details]![End Date])),IIf([Contract Not Expired]=0 And [Contract Details]![Renewal Term]="Original Term","ERROR",0)))
However I need to expand this querry to be able to handle up to 7 renewals, I've now created this code in notepad, see attached. I didn't format the attached code to make it easier to read because I wanted you to see it exactly as it is in the code builder.
When I paste the code into the expression builder and say ok, I don't get an error, but the new code isn't being saved. When I go back into the builder the original code is still there.
Any thoughts on why this is happening?
Thanks.