|
我在模块里自编的函数计算出来的数据为 2357015.172
在报表某字段中引用此函数数据,所显示的数据为 2357015.250
相差太大了,不知是什么原因?求大家帮我!!!
此函数如下:
Public Function hkhj_old(fph As String, bgyf As String) As Single
On Error GoTo errorer
Dim a, b, c, abc As Single
bgyf = Forms!frm打印回款!Combo0
a = DSum("金额", "qu回款_以前发生额", "发票号='" & fph & "' and 月份<'" & bgyf & "'") '以前发生额
b = DSum("回款", "qu回款_以前回款", "发票号='" & fph & "' and 月份<'" & bgyf & "'") '以前回款
c = DSum("银行扣款", "qu回款_以前回款", "发票号='" & fph & "' and 月份<'" & bgyf & "'") '以前银行扣款
If IsNull(a) Or a = "" Then a = 0
If IsNull(b) Or b = "" Then b = 0
If IsNull(c) Or c = "" Then c = 0
abc = a - b - c
hkhj_old = Round(abc, 2)
errorer:
Exit Function
End Function |
|