需要判断录入的
数据加起来是否等于100%,但只要是60 30 10的组合,就
提示不等于1, 其它的任意组合都没有问题,难道60%+30%+10% 不等于1吗?
下面用recordset 累加,也试过用DSUM,也是一样的问题。怪事
Private Sub Command8_Click()
On Error GoTo Err_Command8_Click
kk = Me.A
Dim rst As Recordset
Set rst = Me.子
窗体.Form.Recordset
With rst
.MoveFirst
Do While Not .EOF
.Edit
If .Fields("a").Value = kk Then
PayTIDY = PayTIDY + .Fields("percen").Value
End If
.Update
.MoveNext
Loop
End With
If PayTIDY = 1 Then
MsgBox "OK"
Else
MsgBox "not equeal to 100%, pLease review the records.", vbInformation
End If
Exit_Command8_Click:
Exit Sub
Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
点击下载此附件