If e.DataCol.Name = "确认入库" Then
Dim dr As DataRow
Dim filter1 As String
Dim filter2 As String
Dim filter As String = "1=1"
If e.DataRow.isnull("品名") = False Then
filter &= " and 品名 = '" & e.DataRow("品名") & "'"
End If
If e.DataRow.isnull("批号") = False Then
filter &= " and 批号 = '" & e.DataRow("批号") & "'"
End If
If e.DataRow.isnull("物料编码") = False Then
filter &= " and 物料编码 = '" & e.DataRow("物料编码") & "'"
End If
filter1 = filter & " and [库位] = '" & e.DataRow("库位") & "' and [货权] = '" & e.DataRow("货权") & "'"
filter2 = filter & " and [库位] = '" & e.DataRow("库位") & "' and [货权] = '" & e.DataRow("货权") & "' and [日期]='" & Date.today & "'"
dr = DataTables("总库存表").SQLFind(Filter1 )
If dr IsNot Nothing Then
Dim Sum1 As Single=DataTables("入库明细表").SQLCompute("Sum(入库重量)",filter2)
dr.SQLSetValue("今日入库",sum1)
Else
If dr Is Nothing And e.DataRow("品名")<>Nothing And e.DataRow("确认出入库")=True Then '如果没找到
Dim R4 As Row =Tables("总库存表").AddNew
R4("品名") = e.DataRow("品名")
R4("批号") = e.DataRow("批号")
R4("物料编码") = e.DataRow("物料编码")
R4("库位") = e.DataRow("库位")
R4("货权") = e.DataRow("货权")
R4("今日入库")= e.DataRow("入库重量")
DataTables("总库存表").Save
End If
End If
End If
老师好,麻烦帮我看下这段代码为什么 dr.SQLSetValue("今日入库",sum1)写入不了后台呢?