Recalculating values when user deletes a section? - InfoPath Dev
in

InfoPath Dev

Recalculating values when user deletes a section?

Last post 02-08-2012 08:38 AM by Hilary Stoupa. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-03-2012 12:17 PM

    Recalculating values when user deletes a section?

    I looked for a discussion on this but couldn't find what I need.  I am hoping someone can help me out.  I submitted my form to my manager and subsequently found this error.  I'm hoping to fix it before she encounters it in her review.    

    I have designed a form where the user selects a category in a DDL in a repeating table (e.g <item>) then enters detail information in the related repeating section (e.g. <airDetails> ) .  When the user enters a cost in a <amountAir> in <airDetails> , it triggers a rule to populate the corresponding total control in <item> with the sum of all <amountAir> in <airDetails>.  It works perfectly (my proudest newbie moment).  

    Here's the rub.  If the user enters amounts into a section and subsequently removes the section, the total does not recalculate until a different number is entered into <amountAir>. 

    I am limited to functions and/or expressions to get this done.  Is there some way to cause a field to recalculate when the user deletes a section?  Form is attached.

    ~K

  • 02-03-2012 02:11 PM In reply to

    Re: Recalculating values when user deletes a section?

    Hi - looks like categoryTotal is the field you are setting here. And like a few other fields may set the value in that field - amountOther, for example. Is there conditional formatting in your form such that a user can't add itemOther at the same time as having itemAir?

    If so, instead of using rules, you could just use a default value on categoryTotal that sums up all of your amount fields (i.e., amountOther, amountAir, etc) - as long as the user can't add any amountOther values if the category is Air. Does that make sense?

     

    Hilary Stoupa

  • 02-07-2012 12:27 PM In reply to

    Re: Recalculating values when user deletes a section?

    Hilary,

    Sorry for the delayed response.  That worked great! 

  • 02-07-2012 02:38 PM In reply to

    Re: Recalculating values when user deletes a section?

    Hilary,

    First, let me say how grateful I am for you and all the other kind folks on this forum who have helped me this past week. 

    Your fix worked.  Is there a quick and simple method to prevent the user from changing the drop-down list selection once an amount has been entered into the detail area?  With your fix in place, if a user selects another category on the same row with entered data, the previous summed amount remains in the categoryTotal.   

    ~K

     

  • 02-07-2012 03:28 PM In reply to

    Re: Recalculating values when user deletes a section?

    I'd think you could use conditional formatting on the drop down - but all your detail fields have different names, right? So you'd end up having to add a few conditions.

    You can indicate you want to check for any instance of the repeating field - I'm attaching a screenshot.


    Hilary Stoupa

  • 02-08-2012 08:32 AM In reply to

    Re: Recalculating values when user deletes a section?

    Hilary,

    Thanks again!  Everything is working splendidly now.  You are great! 

     

    ~K

  • 02-08-2012 08:38 AM In reply to

    Re: Recalculating values when user deletes a section?

    Awww, thanks! Glad I could help. :)

    Hilary Stoupa

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