Skip navigation
sm38240
Currently Being Moderated

Changing presence based on value of another calculated field

Apr 6, 2012 8:02 PM

Hi,

 

I am trying to hide a signature field if the value of another calculated field is less than a certain value.  I am attempting to use:

 

 

if (TotalRelUpper.rawValue<150) then

signature.presence="invisible"

endif

 

If I put this formcalc statement in the click section of the calculated field, the signature field presence will change state, but I want it to automatically change state based on the calculated value.

 

Ideas appreciated.

 

Thanks!

 
Replies
  • Currently Being Moderated
    Apr 8, 2012 9:08 AM   in reply to sm38240

    Did you try placing the code in the Calculate event of the field?

     

    Thanks

    Srini

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 10, 2012 7:59 AM   in reply to sm38240

    Stan,

         You are missing the else part in the code..

      

    TotalRelUpper.rawValue=UpperNFC.rawValue+UpperExp.rawValue

     

    if (TotalRelUpper.rawValue<150) then

         VPsignature.presence="invisible" 

    else    

         VPsignature.presence="visible"

    endif

     

    Thanks

    Srini

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 10, 2012 3:50 PM   in reply to sm38240

    try putting it in the layoutReady event

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 10, 2012 8:43 PM   in reply to sm38240

    Hi Stan,

     

    You just need to make sure the last expression evaluated to the calculate event it the one you want in the result, so you can do;

     

    TotalRelUpper.rawValue=UpperNFC.rawValue+UpperExp.rawValue

    if  (TotalRelUpper.rawValue>150)then

        VPsignature.presence="visible"

    else

        VPsignature.presence="invisible"   

    endif

    TotalRelUpper.rawValue

     

    The last line can set there like that, or you could do;

     

    var total=UpperNFC.rawValue+UpperExp.rawValue

    if  (total>150)then

        VPsignature.presence="visible"

    else

        VPsignature.presence="invisible"   

    endif

    TotalRelUpper.rawValue=total

     

    Regards

     

    Bruce

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points