标题: 求教关于模糊查询的一段代码 [打印本页] 作者: lordcatus 时间: 2008-11-22 17:31 标题: 求教关于模糊查询的一段代码 Private Sub Text21_KeyUp(KeyCode As Integer, Shift As Integer)
Dim strCx As String
If Nz(Text16, 0) = 0 Then Me.Child0.Form.FilterOn = False: Exit Sub
If KeyCode = vbKeySpace Then Exit Sub '分隔符不为空格时,可省去
For i = 0 To UBound(Split(Text21.Text, " "))
strCx = strCx & "InStr(" & fldname & ", '" & Split(Text21.Text, " ")(i) & "') > 0 And "
Next i
Me.Child0.Form.Filter = strCx & True
Me.Child0.Form.FilterOn = True
End Sub