没看到你的代码,是不是这个意思?
Dim bms As List(Of String) '领料部门集合bms = DataTables("领料部门").GetValues("部门名称","[是否对账] = true")For Each r As DataRow In DataTables("出库").Select(Tables(e.form.name & "_出库主表").Filter) r("已对账") = bms.Contains(r("领用部门"))Next