久しぶりにAccess触ったら嵌ったので・・・・
なんだこのVBA関数は・・・まともに動かん
'*******************************************************************************************
'注意!!!!!!!!!
'AccessのRound,Int,FIx関数はバグっているので、自ら作成する!
'*******************************************************************************************
'切り上げ
Public Function com_RoundUp(X As Currency, S As Integer) As Currency
Dim W As Currency
W = 10 ^ Abs(S)
If S > 0 Then
com_RoundUp = Int(X * W + 0.999) / W
Else
com_RoundUp = Int(X / W + 0.999) * W
End If
End Function
'切り捨て
Public Function com_RoundDown(X As Currency, S As Integer) As Currency
Dim W As Currency
W = 10 ^ Abs(S)
If S > 0 Then
com_RoundDown = Int(X * W) / W
Else
com_RoundDown = Int(X / W) * W
End If
End Function
'四捨五入
Public Function com_Round(X As Currency, S As Integer) As Currency
Dim t As Integer
t = 10 ^ Abs(S)
If S > 0 Then
com_Round = Int(X * t + 0.5) / t
Else
com_Round = Int(X / t + 0.5) * t
End If
End Function
MSからGetだけ。。。ど(^^;)