http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&replyID=730897&ID=106903&skin=1
其实就是这个问题我看了列子 无法实现我的目的 没办法我用笨办法 做了个按钮
代码
DataTables("库存表").DeleteFor("")
Dim h As New Filler
h.SourceTable = DataTables("订单明细") '指定数据来源
h.SourceCols = "产品编号,产品名称,产品规格"
'指定数据来源列
h.DataTable = DataTables("库存表") '指定数据接收表
h.DataCols = "产品编号,产品名称,产品规格"
'指定数据接收列
h.Fill() '填充数据
Dim idx As
String = "-1,"
Dim idx_temp As
String = ""
Dim pdr As
DataRow = Nothing
Dim count As
Integer = 0
Dim cs As String = "产品名称,产品规格"
For Each dr
As DataRow In DataTables("库存表").Select("", cs)
Dim flag As Boolean = False
If
pdr IsNot Nothing Then
For Each c As String In cs.split(",")
If pdr(c) <> dr(c) Then
flag = True
Exit For
End If
Next
End If
If flag Then
If count > 1 Then
idx &= idx_temp
End If
count = 1
idx_temp = ""
Else
count += 1
idx_temp &= dr("_Identify")
& ","
End If
pdr = dr
Next
If count
> 1 Then
idx &=
idx_temp
End If
Tables("库存表").filter = "_Identify
not in (" & idx.trim(",") &
")"
然后采购表项目 代码
If e.DataCol.Name = "数量" Then
Dim pr As DataRow
pr = DataTables("库存表").Find("产品名称 = '"
& e.DataRow("产品名称")
& "' And 产品规格 = '"
& e.DataRow("产品规格")
& "'")
If pr IsNot Nothing Then
pr("数量")= pr("数量") + e.NewValue - e.OldValue
End If
End If
结果数量 统计不出来 请大神帮我看下 代码怎么写
[此贴子已经被作者于2017/9/18 19:23:20编辑过]