Dim Filter As String
With e.Form.Controls("车号")
If .Value IsNot Nothing Then
Filter = "车号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("规格")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "规格 = '" & .Value & "'"
End If
End With
With e.Form.Controls("到站")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "到站 = '" & .Value & "'"
End If
End With
With e.Form.Controls("收货单位")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "收货单位 = '" & .Value & "'"
End If
End With
If Filter > "" Then
Tables("钢厂发货明细").Filter = Filter
End If
不能模糊查询,要输完整入,输入2个条件查询不了,请指教,谢谢!