哦,谢谢。我去加一些判断语句。
还有,能不能看一看原贴?
我这个处理过程还需要加入其他处理,所以再好能按我的执行过程来修改:
我用了"tables",而没有用“datatables”,我想记录多时,先筛选需要处理的数据,这样能少一些记录数。
Dim mcs As List(Of String) '领料部门集合
mcs = DataTables("领料部门").GetValues("部门名称","[是否对账] = true") ‘根据领料部门表的“是否对账”,确定是否对出库主表进行标志
For Each mc As String In mcs '按名称循环
Tables(e.form.name & "_出库明细表").StopRedraw
Tables(e.form.name & "_出库明细表").Filter = "领用部门 = '" & mc & "' and 已对账 = false"
If Tables(e.form.name & "_出库明细表").Rows.Count>0 '有明细表记录才进行
Tables(e.form.name & "_出库主表").Filter = "领用部门 = '" & mc & "' and 已对账 = false"
'Return
For Each r As Row In Tables(e.form.name & "_出库主表").Rows
r("已对账") = True
Next
'Return
End If
Tables(e.form.name & "_出库明细表").ResumeRedraw
Next