我有MS Access表格可以进行高级搜索,当我在OnChange文本框中键入“玛丽”进行搜索时,我的字母将被颠倒。 我确定我的代码正确。
Dim strSQL1, TestArray() As String
Dim i As Integer
Me.Text32 = Me.Tsearch.Text
TestArray() = Split(Me.Text32, " ")
For i = LBound(TestArray) To UBound(TestArray)
If TestArray(i) <> "" Then
arrayVal1 = arrayVal1 & " telefone.job like '%" & TestArray(i) & "%'" & " And"
Me.TsearchX = Mid(arrayVal1, 1, Len(arrayVal1) - 3)
strSQL1 = "SELECT Top 10 * FROM telefone Where" & Me.TsearchX & " ORDER BY telefone.id desc
End If
Next i
Set rst1 = New ADODB.Recordset
With rst1
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.LockType = adLockOptimistic
.Open strSQL1, cnAccess, adCmdText
End With
Set Me.Query_subform.Form.Recordset = rst1
我希望当我键入字母时,它们显示正确而不是相反。 我的样品在这里。请看一下,如果可能的话指导我 ado advanced search