Display "yes" or "no" on form based on mathematical calculation? - InfoPath Dev
in

InfoPath Dev

Display "yes" or "no" on form based on mathematical calculation?

Last post 02-28-2011 08:34 AM by Max M. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 02-27-2008 09:27 AM

    Display "yes" or "no" on form based on mathematical calculation?

    I posted this once a few minutes ago, but I got a blank page back so I hope it's not a repeat question. I'm creating a form for a new policy at our agency that will allow the purchase of non-restricted airfares rather than government fares. The restricted fares can only be purchased if the cost savings on the restricted ticket is at least 25% of the total cost of the government fare. With me so far?

    My boss wants the form to have a section that says, "Does the restricted fare meet the 25% rule?" and automatically display Yes or No based on the amounts for each ticket. I have created 4 fields so far: Government fare cost, restricted fare cost, savings to government, and 25% of government fare. The last two populate automatically based on the ticket costs. I created another text box to show the Yes or No value. I edited the properties and created 2 rules for the box: 1) If the savings is greater than or equal to the amount in the percentage field, display YES; and 2) If the savings is less than the amount in the percentage field, display NO. The action for the rule reads, Set a field's value: .="YES"

    I want the field to be read only, and automatically fill in. However, it doesn't populate automatically. Only if I turn off the read only option and type junk text in there does it fill in. If I change the values for the ticket costs, it doesn't update either.

    Can anyone help me solve this problem? Thanks in advance for any help!

  • 02-27-2008 11:10 AM In reply to

    Re: Display "yes" or "no" on form based on mathematical calculation?

    I figured it out!! No need to reply...

  • 02-27-2008 11:15 AM In reply to

    Re: Display "yes" or "no" on form based on mathematical calculation?

    Good work.

     Foir others benefit:

    You should be able to use a rule with a condition based on the savings value that would set the field from a default no to yes if it is true.

    Also then use conditional formatting on a field or section to hide it if it is no.

  • 02-17-2011 01:33 PM In reply to

    Re: Display "yes" or "no" on form based on mathematical calculation?

    So this is the closest entry I have found for my question. I am trying to set a field value based on another field. In my case I am trying to set status to be A, B, C . . . . depending on what the answers to questions are. So if the first question is no, the status should be Failed Resume Screen. If yes, the status should be "Needs Phone Screen" . . . and so forth. So I created a rule, but the field only updates if I go into the field and type something in and click away. I want this field to update automatically. How can I do this? Let me know if this is not a clear explanation.

     Thanks,

    Frankie D.

  • 02-18-2011 06:01 AM In reply to

    Re: Display "yes" or "no" on form based on mathematical calculation?

    Here's how I did it for yes/no questions:

    The yes/no selections are radio buttons. The radio buttons have rules specifying what text to place in another text box based on the user's selection. So my radio buttons for question 1 have two rules. The first says if Field1 (the radio buttons) = 1 (value for yes), set a field's value (Field 2, the text box) to "You meet the criteria." The second rule says if Field 1 = 2 (value for no), set a field's value (Field 2, the text box) to "You do not meet the criteria."

    The text box updates whenever the selection is changed and is blank until one is made. Is that what you're trying to do? Remember to set the rule on the field with your answers, not where you want the answer to appear.

  • 02-18-2011 07:28 AM In reply to

    Re: Display "yes" or "no" on form based on mathematical calculation?

    OMG . . . . i feel silly. I was putting the rule in the field I want the text displayed and not the field with the answers. That makes perfect sense. Thank you very much, I greatly appreciate your help.

     

    Thanks,

    Frankie D.

  • 02-18-2011 07:32 AM In reply to

    Re: Display "yes" or "no" on form based on mathematical calculation?

    I did the same thing at first. Glad I could help!

  • 02-28-2011 08:20 AM In reply to

    • Max M
    • Not Ranked
    • Joined on 02-10-2011
    • Posts 9

    Re: Display "yes" or "no" on form based on mathematical calculation?

    Hi everyone, this is similar to my problem: I have a boolean variable that I want to show as "Yes" or "No" in a read-only text-box based on whether it is True or False. Any suggestions??

  • 02-28-2011 08:24 AM In reply to

    Re: Display "yes" or "no" on form based on mathematical calculation?

    Use two expression boxes (calculated values in IP 2010). The value of one would be "Yes", the other "No". Add conditional formatting to show or hide based on the boolean field.

    Hilary Stoupa

  • 02-28-2011 08:34 AM In reply to

    • Max M
    • Not Ranked
    • Joined on 02-10-2011
    • Posts 9

    Re: Display "yes" or "no" on form based on mathematical calculation?

    I was able to do it by changing the field to a combo-box. Then I changed the display name for "True" to "Yes", and the one for "False" to "No". Then I removed the default entry, and set false as the default in case the field is blank. Then I applied a conditional formatting to disable the control if the field is blank or is not blank.

     The only difference from what I originally wanted is that it has a greyed-out down arrow next to the word. Oh well.

Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.