jamescullis
Registered User.
- Local time
- Today, 18:21
- Joined
- Jun 2, 2014
- Messages
- 38
Hi,
I have a continuous form with the recordsource from a query. I have a Unbound textbox and would like to search on more than one field which is what the below code is currently doing.
other field names
- jobNumber (number field)
- suburbName (text field)
- jobInformation (text field)
- installDate (date field)
Can someone please point me in the right direction?
thanks
I have a continuous form with the recordsource from a query. I have a Unbound textbox and would like to search on more than one field which is what the below code is currently doing.
other field names
- jobNumber (number field)
- suburbName (text field)
- jobInformation (text field)
- installDate (date field)
Can someone please point me in the right direction?
thanks
Code:
Private Sub txtSearch_Change()
Dim strFilter As String
On Error GoTo ErrHandler
If Me.txtSearch.Text <> "" Then
strFilter = "[subNickName] Like '*" & Me.txtSearch.Text & "*'"
Me.Filter = strFilter
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
End If
With Me.txtSearch
.SetFocus
.SelStart = Len(Me.txtSearch.Text)
End With
Exit Sub
ErrHandler:
MsgBox Err.Description, vbExclamation
End Sub