Kayleigh
Member
- Local time
- Today, 10:01
- Joined
- Sep 24, 2020
- Messages
- 706
Hi,
I have this function which works great to search within continuous form however when I backspace in the search box, it doesn't amend the search results. Can anyone suggest how this would be possible?
I have this function which works great to search within continuous form however when I backspace in the search box, it doesn't amend the search results. Can anyone suggest how this would be possible?
Code:
Private Sub SearchFor_Change()
On Error GoTo Err_SearchFor_Change
Dim strFilter As String
If Not IsNothing(Me.SearchFor.Text) Then
If Not IsNothing(Me.Filter) Then
strFilter = Me.Filter & " AND "
End If
strFilter = strFilter & " ( [cfStaffName] Like '*" & Me.SearchFor.Text & "*' OR [fldDNote] Like '*" & Me.SearchFor.Text & "*' OR [fldDComment] Like '*" & Me.SearchFor.Text & "*' )"
Me.Filter = strFilter
Me.FilterOn = True
End If
With Me.SearchFor
.SetFocus
.SelStart = Len(Me.SearchFor.Text)
End With
Exit Sub