Search Continuous Form with one textbox

basilyos

Registered User.
Local time
Today, 11:32
Joined
Jan 13, 2014
Messages
256
hello, i have a continuous form for now i can search just one field with this code

Code:
Dim strFilter As String

    If Len(Trim(Me.txt_Search.Value & vbNullString)) > 0 Then
        strFilter = "Clientname Like '*" & Replace(Me.txt_Search.Value, "'", "''") & "*'"
        Me.Filter = strFilter
        Me.FilterOn = True
        Me.txt_Search.SetFocus
        Me.txt_Search.Value = ""
    Else
        Me.FilterOn = False
        Me.txt_Search.SetFocus
        Me.txt_Search.Value = ""
    End If

is there anyway to search 4 fields at the time from txt_Search
 
Code:
    If Len(Trim(Me.txt_Search.Value & vbNullString)) > 0 Then
        strFilter = "Clientname Like '*" & Replace(Me.txt_Search.Value, "'", "''") & "*' Or " & _
        "AnotherField Like '*" & Replace(Me.txt_Search.Value, "'", "''") & "*' Or " & _
        "AnotherField2 Like '*" & Replace(Me.txt_Search.Value, "'", "''") & "*' Or " & _
        "AnotherField3 Like '*" & Replace(Me.txt_Search.Value, "'", "''") & "*'"
 
works perfect. thanks
 

Users who are viewing this thread

Back
Top Bottom