[AccessD] Data entry in table question

Max Wanadoo max.wanadoo at gmail.com
Thu Jul 23 16:09:50 CDT 2009


And this..

You can use the numeric type "Decimal" which has the highest level of
precision (18).

Also, you can use a combination of the Fix() and Eval() functions to enforce
the numeric integrity of your values. For example, this messing looking
function accurately rounds a value (using proper, bankers rounding, not
scientific rounding as Access does natively):

Code:

Public Function Round(ByVal Number As Double, Optional ByVal
NumDigitsAfterDecimal As Integer = 0) As Double
    Round = Fix(Eval(Number * (10 ^ NumDigitsAfterDecimal) + (0.500000000001
* Sgn(Number)))) / (10 ^ NumDigitsAfterDecimal)
End Function


From:

http://www.utteraccess.com/forums/showflat.php?Cat=&Number=1808628&page=&vie
w=&sb=5&o=&vc=1

Max



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester
Sent: 23 July 2009 21:59
To: Access Developers discussion and problem solving
Subject: [AccessD] Data entry in table question

When I type a number with eight decimal places into a table with data type
of single the last digit changes when saved. What is happening?


Chester Kaup

Engineering Technician

Kinder Morgan CO2 Company, LLP

Office (432) 688-3797

FAX (432) 688-3799





No trees were killed in the sending of this message. However a large number
of electrons were terribly inconvenienced.

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list