是这样吗?还是没数据。如果把and 变为or,不符合条件的人也进来了
Dim filter As String = "1=1"
For Each dr As DataRow In DataTables("xmgl").Select("岗位='" & e.Form.Controls("TextBox1").text & "'")
filter = filter & " and (工作项='" & dr("工作项") & "' and 完成值 >=" & dr("最小值") & ")"
Next
filter = "岗位='" & e.Form.Controls("TextBox1").text & "' and (" & filter & ")"
msgbox(filter)
Dim nr As DataRow
For Each ss As String() In DataTables("daily").GetValues("姓名|岗位",filter)
If DataTables("userinfo").Find("姓名='" & ss(0) & "' And 岗位='" & ss(1) & "'") Is Nothing
nr = DataTables("userinfo").AddNew
nr("姓名") = ss(0)
nr("岗位") = ss(1)
End If
Next