Awes
Usually Confused
- Local time
- Today, 13:21
- Joined
- Aug 20, 2002
- Messages
- 34
Hi everyone
I am having a bit of fun (headaches) with an addition problem on a form.
At the bottom of the form there is a group of textboxes used for calculating values as follows:
Group A - totals the values in one of the two subforms
Group B - totals the values in the other subform
Sub Tot - Adds Group A and Group B together
VAT1 - Works out the VAT at 17.5% for Sub Tot
Group C - Retrieves a value from a query
VAT2 - Works out the VAT at 5% for Group C
Total - Adds Sub Tot, VAT1, Group C and VAT2 together
All values are in the format £0.00
This all seemed to be working fine until the User reported that some values of Total seemed to be £0.01 too high.
On futher investigation it appears that whenever one of the VAT values is equal to an exact amount of 0.5 pence it gives an error in the Total box by being £0.01 too high
i.e
Group A £20.00
Group B £11.00
Sub Tot £31.00
VAT1 £ 5.42 (actually £5.425)
Group C £ 5.00
VAT2 £ 0.25
Total £61.68 (actually £41.67)
All other instances work ok it is just when one of the VAT values is exactly a half pence. VAT1 or VAT2 display what looks like a rounded down value but the Totals box is rounding up.
Any ideas on how to solve this problem. I'm sure it is something to do with formatting but any pointers would be greatly appreciated.
Cheers
Awes
I am having a bit of fun (headaches) with an addition problem on a form.
At the bottom of the form there is a group of textboxes used for calculating values as follows:
Group A - totals the values in one of the two subforms
Group B - totals the values in the other subform
Sub Tot - Adds Group A and Group B together
VAT1 - Works out the VAT at 17.5% for Sub Tot
Group C - Retrieves a value from a query
VAT2 - Works out the VAT at 5% for Group C
Total - Adds Sub Tot, VAT1, Group C and VAT2 together
All values are in the format £0.00
This all seemed to be working fine until the User reported that some values of Total seemed to be £0.01 too high.
On futher investigation it appears that whenever one of the VAT values is equal to an exact amount of 0.5 pence it gives an error in the Total box by being £0.01 too high
i.e
Group A £20.00
Group B £11.00
Sub Tot £31.00
VAT1 £ 5.42 (actually £5.425)
Group C £ 5.00
VAT2 £ 0.25
Total £61.68 (actually £41.67)
All other instances work ok it is just when one of the VAT values is exactly a half pence. VAT1 or VAT2 display what looks like a rounded down value but the Totals box is rounding up.
Any ideas on how to solve this problem. I'm sure it is something to do with formatting but any pointers would be greatly appreciated.
Cheers
Awes