8楼的代码无需你另外增加一个逻辑列,会自动判断。
如果要自动打勾:
For Each dr As DataRow In DataTables("补偿标准表").dataRows
Dim nms() As String = {"土地补偿","房屋补偿"}
For Each nm As String In nms
For Each c As col In Tables(nm).cols
If c.name.StartsWith(dr("补偿物名")) Then
dr("使用情况") = True
Exit For
End If
Next
If dr("使用情况") = True Then
Exit For
End If
Next
Next