If e.DataCol.Name = "管辖部门" Then
Dim Filter As String = "[管辖部门] = '" & e.NewValue & "'"
e.DataRow("数量") = DataTables("销售资料").sqlCompute("Sum(数量)", Filter)
e.DataRow("金额") = DataTables("销售资料").sqlCompute("Sum(吊牌单价*数量)", Filter)
e.DataRow("销售金额") = DataTables("销售资料").sqlCompute("Sum(销售单价*数量)", Filter)
e.DataRow("入库数量") = DataTables("采购明细").sqlCompute("Sum(数量)", Filter)
e.DataRow("入库金额") = DataTables("采购明细").sqlCompute("Sum(数量*单价)", Filter)
e.DataRow("出库数量") = DataTables("出库明细").sqlCompute("Sum(数量)", Filter)
e.DataRow("出库金额") = DataTables("出库明细").sqlCompute("Sum(数量*单价)", Filter)
e.DataRow("退货数量") = DataTables("退货明细").sqlCompute("Sum(数量)", Filter)
e.DataRow("退货金额") = DataTables("退货明细").sqlCompute("Sum(数量*单价)", Filter)
End If
老师sqlcomputer 为什么在销售资料数量发生变化不会跟新,用Compute就马上更新了,,但是金额是单价*数量的,又不能用computer会报错,,这个是怎么解决的
这句是在销售表里刷新统计表的
Select Case e.DataCol.Name
Case "数量" , "销售单价", "条码"
Dim tj As DataRow
tj = DataTables("统计表").Find("管辖部门 = '" & e.DataRow("管辖部门") & "'")
If tj IsNot Nothing Then
DataTables("统计表").DataCols("管辖部门").RaiseDataColChanged(tj)
End If
End Select