Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
我有一个姓名列是多值字段,在查询窗口中我发现,不能查询出包含其中一个姓名行,请问该怎么写代码?谢谢
With e.Form.Controls("Textbox")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "姓名 like '" & .Value & "'"
End If
End With
要加上*号,如:
Filter = Filter & "姓名 like '*" & .Value & "*'"
能否在一个文本框中查询多个值.比如[性名]列中,我要筛选出姓刘的和姓李的, 刘,李
窗口按钮中这样试试
Dim Filter As String = e.Form.Controls("姓名").Value
If Filter > "" Then
If Filter.Contains(",") Then
Filter = "'" & Filter.Replace(",","','") & "'"
Tables("表A").Filter = "[姓名] In (" & Filter & ")"
Else
Tables("表A").Filter = "[姓名] = '" & Filter & "'"
End If
End If
窗口按钮中这样试试
Dim Filter As String = e.Form.Controls("姓名").Value
If Filter > "" Then
If Filter.Contains(",") Then
Filter = "'" & Filter.Replace(",","','") & "'"
Tables("表A").Filter = "[姓名] In (" & Filter & ")"
Else
Tables("表A").Filter = "[姓名] = '" & Filter & "'"
End If
End If
测试通过,谢谢CZY