在你的Text14控件更改事件后再加入以下两行代码即可.
Me.Text14.SetFocus
Me.Text14.SelStart = Len(Nz(Text14, "0"))
修改后如下:
Private Sub Text14_Change()
Dim strWhere As String
Dim ctl As Control
Dim ctlname As String
strWhere = Trim$(Me.Text14.Text)
For Each ctl In Me.frmcj_list.Form.Controls
If TypeOf ctl Is TextBox Then
ctlname = ctlname & "[" & ctl.Name & "] & "
Debug.Print ctlname
End If
Next
ctlname = Left(ctlname, Len(ctlname) - 3)
Debug.Print ctlname
strWhere = "" & ctlname & " like '*" & strWhere & "*'"
Debug.Print strWhere
Me.frmcj_list.Form.Filter = strWhere
'应用筛选
Me.frmcj_list.Form.FilterOn = True
Me.Text14.SetFocus
Me.Text14.SelStart = Len(Nz(Text14, "0"))
End Sub