老师现在代码如下:专业名称哪儿不能模糊查询,怎么修改呢?
比如我专业名称列专业有:公路,
公路、市政, 公路、市政、水利,当选择公路查询时,这三个专业的都显示出来。
Dim Filter As String = "1=1"
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 & "证件名称 like '%" & .Value & "%'"
End If
End With
With e.Form.Controls("专业名称")
If .Value IsNot Nothing Then
Filter &= " and 专业 in ('" & .Text.Replace(",", "','") & "')"
End If
End With
If Filter > "" Then
Tables("人员证件").Filter = Filter
End If
[此贴子已经被作者于2017/8/2 12:43:31编辑过]