Data validation error - InfoPath Dev
in

InfoPath Dev

Data validation error

Last post 06-03-2010 08:15 AM by Anonymous. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-03-2010 07:44 AM

    Data validation error

    Hi all,

    Really hoping someone can help with a seriously irritating error/glitch I'm encountering in IP2007.  I currently have 2 fields on a form - "Total Due" and "Total Paid", both fields are set as decimal data types and both are fields are the sum total of 3 other fields (AmountDue1, AmountDue2, AmountDue3 & AmountPaid1,AmountPaid2, AmountPaid3).  What is crucial is that the amounts that are populated in both of these fields are the same (e.g., the amount due matches the amount paid).  I have tried setting data validation rules on the "Total Paid" field to say that if "Total Paid" does not equal "Total Due" display an error.  This should be very simple but only seems to work about 90% of the time...the other 10% of the time the data validation flags that there is an error on the field even when both totals match!?

    I've some playing around with figures to try and determine the issue and have only managed to discover that that data validation flags an error only when the figures making up the "Total Due" are not the same as the figures making up the "Total Paid" (e.g. Amounts Due are £4,865.8, £633.64 & £136.63 - totalling £5,636.07 and Amounts Paid are £0, £0 & £5,636.07).  Obviously the total amounts are correct so I can't figure out why the data validation is flagging them.

    As a workaround I've also tried creating a "Balance" field and set the default value to "AmountDue - AmountPaid" and then set a rule on the Balance field to say that if Balance is not equal to 0, create an error.  This is also not working and creating the same issue - Balance is equal to 0 (field is set as decimal data type and I've tried setting the field to display as many 0's as possible) but the error message comes up.

    Can anyone shed some light on this for me? It's really doing me in as it should be something really simple and seems like this is exactly what data validation should be used for

    Thanks for your help!!

    Filed under: ,
  • 06-03-2010 08:15 AM In reply to

    Problem sorted!  Found this formula on another forum for rounding numbers and used it in my balance field as per below:

    round((sum(value)) * 100) * .01

    So the formula I put in the "Balance" field is now round((sum(TotalDue)) * 100) * .01 - round((sum(TotalPaid)) * 100) * .01

    The data validation no longer flags up any errors when the Balance is equal to 0!

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