I have been messing about testing which would be the best data type to use with an MDB for money calculations, to avoid rounding errors
It does seem the way to do it is define your money field as CURRENCY in the MDB (which I honestly didn't think you could do), and then access it in IWB with a DOUBLE variable, and using SETPRECISION 2
Play with the code, and see the results of using CURRENCY, FLOAT and INT
I have used SETPRECISION 8 in this example, to show the rounding errors using FLOAT
Currency (I have read on the internet) is a data type that is called a scaled integer (so it is an integer value that ALSO stores the number of decimal places). These numbers are thus not floating point numbers but are stored as exact values along with a decimal placeholder
Edit: Slight speed modification
Great ! Thank you for sharing the code.