tech on the net

MS Access: CDec Function

In Microsoft Access, the CDec function converts a value to a decimal number.

Syntax

The syntax for the CDec function is:

CDec( expression )

expression is the value to convert to a decimal number.

Applies To

VBA Code

The CDec function can be used in VBA code. For example:

Dim LDecimal As Double

LDecimal = CDec(8.45 * 0.005 * 0.01)

The variable called LDecimal would now contain the value of 0.0004225.