I have been trying to search this, but I just can't figure it out. I want to have two separate if then expressions execute on a calculate event. I can only ever get the first one to execute. I need to have a "Rush" box checkmarked if the difference between 2 days is less than 10. Then I also need to have the box change to visible if the box is checkmarked. Here is my code.
if (IsoDate2Num(ClosingDate) - IsoDate2Num(DateReq)<="10") then form1.FloodDet.Rush.rawValue=1 endif;
if (Rush.rawValue==1) then Reason.presence = "visible" else Reason.presence = "invisible" Reason.rawValue = " " endif;
Help me get this working pretty please!
I realize I could probably just put them on separate fields but I figured there HAS TO be a way to do it this way.
both if statement are wrong using formcalc
If the code above is still not working, try using Date2Num instead of IsoDate2Num, it basically does the same thing, I just never used IsoDate2Num
Hope this help!
Yes, this definitely allowed me to put both of the If statements in the same event. Thank you! (I still have a lot to learn about the syntax of this stuff, I swore I had it right. I guess not )
One more question. Like I said, the "Rush" box will be automatically check marked if less than 10 days, then a "Reason for rush" box will open.
So for a while, I had each of these "IF" statements on separate fields. When I put the statement regarding visibility on the "reason for rush" field (calculate event) it shows the word "visible" in the text field. Any idea why this is happening? (see attached picture below.)
Calculate event is set to purpose of setting the value's field for the user.
So the last line of code in the calculate event is the value inserted in the field...
So depends on what code you have written, this is what it returns
Excellent! Thank you for your help. With both of these tips, I was able to solve both of my issues.