帮你一下代码吧,如果要限制,要这样写。
Dim drs As List(Of DataRow)
Dim xj As WinForm.textBox = e.Form.Controls("姓名")
If xj.Text > "" Then
Dim fdr As DataRow = DataTables("收购").find("[姓名] = '" & xj.Text & "' and [凭证号] is null")
If fdr IsNot Nothing Then
Dim Filter As String
Filter = "[姓名] = '" & xj.Text & "' and 凭证号 Is null And [重量] <> 0 And [日期] = #" & vars("adate") & "#"
drs = Tables("打印收购窗口_Table1").DataTable.Select(filter)
Dim idxs As String = ""
Dim count As Integer = 0
For count To drs.Count - 1
If count = 5 Then
Exit For
End If
idxs = drs(count)("_Identify") & ","
Next
Tables("打印收购窗口_Table1").filter = "_Identify in (" & idxs.trim(",") & ")"
End If
End If
[此贴子已经被作者于2014-5-9 15:47:19编辑过]