Office中国论坛/Access中国论坛

标题: [求助]在access里怎么实现模糊查询阿? [打印本页]

作者: ctcyrgb    时间: 2005-9-15 03:07
标题: [求助]在access里怎么实现模糊查询阿?
[求助]在access里怎么实现模糊查询阿?
作者: onlyfish    时间: 2005-9-15 20:39
代码如下:

Private Sub Command143_Click()

On Error GoTo Err_Command143_Click    Dim strWhere As String

   

    strWhere = ""

   

   

    If Not IsNull(Me.FINDBL) Then

        

        strWhere = strWhere & "([OBL] like '*" & Me.FINDBL & "*') AND "

    End If

   

   

   

    If Len(strWhere) > 0 Then

        

        strWhere = Left(strWhere, Len(strWhere) - 5)

    End If

   

   

    Debug.Print strWhere

   

   

   

    Me.Filter = strWhere

    Me.FilterOn = True

   

   

    Exit_Command143_Click:

    Exit SubErr_Command143_Click:

    MsgBox Err.Description

    Resume Exit_Command143_Click

    End Sub
作者: ctcyrgb    时间: 2005-9-17 02:47
thanks
作者: dakota    时间: 2005-10-10 16:46
不错啊.




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3