InfoPath 2003 - How do I pass results from a calculate field as a default to another field? - InfoPath Dev
in

InfoPath Dev

InfoPath 2003 - How do I pass results from a calculate field as a default to another field?

Last post 07-23-2009 12:47 PM by gdgonzal. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 07-22-2009 09:21 AM

    InfoPath 2003 - How do I pass results from a calculate field as a default to another field?

    Hello,


    I have a form in which I calculate an estimated budget based on some assumptions.  Beneath this I have actual budget, but I would like to prepopulate this field with the estimate budget as a default.  I am able to do this by referencing the @Est3rdPartyBudget field within default of the Actual 3rd Party Budget field and then use 'Update this value when the result of the formula is recalculated.'

    But here's my issue, when the Actual 3rd Party Budget is determine I want to be able to override the default Estimate Budget and then submit this to the Access dbase.  This also works;however, when I requery the record the Actual 3rd Party Budget is defaulting to the Est3rdPartyBudget because the 'Update this value when the result of the formula is recalculated.' is enabled.  If I disable this it returns the correct value from the Access dbase but then new records default to what's in the dbase...0.  

    OK, so I do have retain the ability to show my desired default of Est3rdPartyBudget in the Actual 3rd Party budget field without enabling 'Update this value when the result of the formula is recalculated.'?  I should also so mention that everything under the estimate section is calculated on the fly when the record is looked up within InfoPath 2003.  On the Access dbase side of things these are defaulting to 0, unless the record is submiited to Access 2003, thanks. 

     

  • 07-22-2009 09:35 AM In reply to

    Re: InfoPath 2003 - How do I pass results from a calculate field as a default to another field?

    Use rules instead of default values then.

  • 07-22-2009 09:42 AM In reply to

    • KjpInc
    • Not Ranked
      Male
    • Joined on 07-16-2009
    • London
    • Posts 5

    Re: InfoPath 2003 - How do I pass results from a calculate field as a default to another field?

    There is a option of adding rules when the form open. Tools-->FormOptions-->OpenAndSave Any rule that you put in there will be calculated everytime, you open the form. Even when you open the saved forms as well. So the rule you are using to calculate the field, use the same rule here as well. Hope it helps.
    Jag - SharePoint Developer
    EMC Application Consulting
  • 07-22-2009 09:47 AM In reply to

    Re: InfoPath 2003 - How do I pass results from a calculate field as a default to another field?

    Well, it only calculates when you tell it to.  Form Load rules should have conditions telling them what to do and when.

  • 07-22-2009 02:00 PM In reply to

    Re: InfoPath 2003 - How do I pass results from a calculate field as a default to another field?

    Yes, I've tried using rules and it doesn't seem to work.  Perhaps you could be a bit more specific...sorry to be so thick.  Here's what I've done:

    1. Opened properties for the field @ActualThirdPartyBudget
    2. Clicked on Rules then Add
    3. Set Condition to None-This rules always applies (I've also tried to use when ActualThirdPartyBudget=0...and a few others)
    4. Clicked on Add Action and selected Set a field's value
    5. Selected the Field as ActualThirdPartyBudget which is displayed as .
    6. Selected the Value by inserting a field named @Product_Estimated_Sell_Amt (this is just to test this is working, my plan would be to replace this with a formula that is based on this field and this field has a value from Access 2003 tbl)

    When I query a record @Product_Estimated_Sell_Amt shows a value of $350,000.00 but @ActualThirdPartyBudget field reflects 0.  Not sure why this doesn't work...thanks for the assistance.

     

     

  • 07-22-2009 02:27 PM In reply to

    • KjpInc
    • Not Ranked
      Male
    • Joined on 07-16-2009
    • London
    • Posts 5

    Re: InfoPath 2003 - How do I pass results from a calculate field as a default to another field?

     

     Try putting the rule on the @Product_Estimated_Sell_Amt. For example,

    Condition: When  @Product_Estimated_Sell_Amt > 0

    Action: Set fields value: @ActualThirdPartyBudget = @Product_Estimated_Sell_Amt

    This way the  field @ActualThirdPartyBudget will always change as long as the @Product_Estimated_Sell_Amt value is more than 0.

    What I have found is that if you put the rule on the field you want to change, even if it is set to run all the time, it doesn't fire. It needs an event for the rule to fire.

    Hope this helps. Let us know.
    Jag - SharePoint Developer
    EMC Application Consulting
  • 07-22-2009 04:14 PM In reply to

    Re: InfoPath 2003 - How do I pass results from a calculate field as a default to another field?

    Probably because you set the rule on itself.  Rules fire when something changes on the field where you applied it.  To set a vlue on 3rdPartyBudget, you'd need to put the rule on the dropdown field that is being selected that would then fire the data into this field.  That's probably the only thing you're missing...

    If the event is not based on another field, then put it in the Form Load rules.  We already mentioned doing it at Tools > Form Options > Open and Save, so I thought you knew to put this rule there.

  • 07-23-2009 12:47 PM In reply to

    Re: InfoPath 2003 - How do I pass results from a calculate field as a default to another field?

    That did the trick!  Thanks
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.