Dim Filter As String
With e.Form.Controls("CmBPrid")
If .Value IsNot Nothing Then
Filter = "申请单号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TBUser")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(申请人, 'System.String') like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("CmBProj")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "工程号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("TbMN")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(物料名称, 'System.String') like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("TBMd")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(规格图号, 'System.String') like '%" & .Value & "%'"
End If
End With
If Filter > "" Then
Tables("采购申请子表").Filter = Filter
End If