我在《去向》表的datacolchanged事件中写了:
Select Case e.DataCol.Name
Case "出厂批号1"
Dim cnt,cnt2 As Single
cnt = DataTables("去向").Compute("Sum(消耗1)", "出厂批号1 = '" & e.NewValue & "'")
cnt2 = DataTables("去向").Compute("Sum(进厂数量1)", "出厂批号1 = '" & e.NewValue & "'")
If cnt>cnt2 Then
Output.Show("此批号原料消耗数量:" & cnt &" 大于" &"进厂数量:" & cnt2 &"!! 请选下一批号.")
End If
Case "出厂批号2"
Dim cnt,cnt2 As Single
cnt = DataTables("去向").Compute("Sum(消耗2)", "出厂批号1 = '" & e.NewValue & "'")
cnt2 = DataTables("去向").Compute("Sum(进厂数量2)", "出厂批号1 = '" & e.NewValue & "'")
If cnt>cnt2 Then
Output.Show("此批号原料消耗数量:" & cnt &" 大于" &"进厂数量:" & cnt2 &"!! 请选下一批号.")
End If
End Select
但无任何反应,为什么?应该怎么改?