Currency format and calculated fields (1 Viewer)

Malcy

Registered User.
Local time
Today, 08:02
Joined
Mar 25, 2003
Messages
586
I am having fun!
An insurance premium refund has to be calculated based on rates and number of days etc. The maths gives this a value of (for instance) 9.0083. This shows up in txtPremium as 9.01 which is OK. You then enter the amount of the refund (txtRefund) given as 9.01 and process the refund.
Part of my programme says if the value of the refund and the premium are identical then the refund is full and complete. But txtRefund has a value of 9.01 and txtPremium, despite showing 9.01, actually is 9.0083, so the two are not identical and Access will not recognise it as a full refund.
The nub lies in how do I get the calculated field to log and store the value as a proper two decimal point value in the first place - and yes the value does have to be logged for audit process and cannot be calculated on the fly.
Any pointers most appreciated since this is getting on my nerves.
Thanks
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:02
Joined
Aug 30, 2003
Messages
36,137
I would use the Round() function to force the calculation to 2 digits.
 

Malcy

Registered User.
Local time
Today, 08:02
Joined
Mar 25, 2003
Messages
586
Nice one Paul
Thanks very much. I had forgotten that sometimes the solution is so easy!!!
Best wishes
 

Users who are viewing this thread

Top Bottom