Foxtable(狐表)用户栏目专家坐堂 → 如何实现模糊搜索


  共有2907人关注过本帖树形打印复制链接

主题:如何实现模糊搜索

帅哥哟,离线,有人找我吗?
tanjon
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:19 积分:202 威望:0 精华:0 注册:2014/2/21 15:13:00
如何实现模糊搜索  发帖心情 Post By:2014/2/22 17:51:00 [显示全部帖子]

请专家看看以下的代码,能否帮我改成模糊搜索,譬如,F4这一列,有:英语、法语、日语这些词,在相对应的搜索框,输入“英语”,能搜索出相应的条目,但如果只输入“英”,就不能搜索出任何条目,恳请专家帮忙,也请帮忙指出在“帮助文件”里哪里能找到相关的资料。谢谢。

Dim Filter As String
With e.Form.Controls("TextBox1")
    If .Value IsNot Nothing Then
        Filter = "F1= '" & .Value & "'"
    End If
End With
With e.Form.Controls("TextBox2")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "F3= '" & .Value & "'"
    End If
End With
With e.Form.Controls("TextBox3")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "F5= '" & .Value & "'"
    End If
End With
With e.Form.Controls("TextBox4")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "F4= '" & .Value & "'"
    End If
End With
If Filter > "" Then
    Tables("全部编制").Filter = Filter
End If

 回到顶部