Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim m, n As Long
m = Me.yO1 + Me.y02 + Me.y03 + Me.y04 + Me.y05 + Me.y06 + Me.y07 + Me.y08 + Me.y09 + Me.y10 + Me.y11 + Me.y12
n = Me.统计1 + Me.统计2 + Me.统计3 + Me.统计4
If m <> n Then
MsgBox "wrong"
Cancel = True
' Me.Undo
End If
End Sub