Dim Filter As String
Dim idx As String = "-1,"
Dim pdr As DataRow = Nothing
Dim cs As String = "工序,设备名称,机床代号,机床编号,计划作业人员,按时间加工单价"
Dim flag As Boolean
For Each dr As DataRow In DataTables("工艺内容").Select("工序 is not null ", cs)
flag = False
If pdr IsNot Nothing Then
For Each c As String In cs.split(",")
If pdr(c) <> dr(c) Then
flag = True
Exit For
End If
Next
End If
If flag Then
idx &= pdr("_Identify") & ","
End If
pdr = dr
Next
If pdr IsNot Nothing Then
idx &= pdr("_Identify") & ","
End If
filter = "_Identify in (" & idx.trim(",") & ") and 工序 is not null "
msgbox(Filter)
Dim t1 As String = e.Form.Controls("DropBox1").Text
Dim t01 As String = e.Form.Controls("TextBox3").Text
If t1 <> Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "工序= '" & t1 & "'"
msgbox(Filter)
End If
If t01 <> Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "机床编号= '" & t01 & "'"
msgbox(Filter)
End If
Dim txt As String = e.Form.Controls("TextBox1").Text 我把其他代码整合后,筛选条件只有TextBox2最后输入数据有效,如何才能达到6楼的效果?
Dim txt1 As String = e.Form.Controls("TextBox2").Text
Dim tbl As Table = Tables("四级表|工序_Table1")
If txt = "" OrElse txt1 = "" Then
Filter = Filter
msgbox(Filter)
Else
Filter = Filter & " and " & txt & "='" & txt1 & "'"
msgbox(Filter)
If Tables("四级表|工序_Table1").Filter > "" Then
Filter = Filter & " and " & txt & "='" & txt1 & "'"
msgbox(Filter)
End If
Tables("四级表|工序_Table1").Filter = Filter
End If
If Filter > "" Then
Tables("四级表|工序_Table1").Filter = Filter
End If
[此贴子已经被作者于2024/10/25 16:08:14编辑过]