Hello Dear friends, I use a search code in my form, I modified but it shows me an error:
The original code is which is working (it searches the specified field)
Private Sub cmdSearch_Click()
Dim bkmk As Variant
Dim strField As String
Me.RecordsetClone.MoveFirst
'Find the first record that matches what
'is in the search text box.
Me.RecordsetClone.FindFirst "Brand Like" _
& Chr(34) & Me.txtSearch & "*" & Chr(34)
If Me.RecordsetClone.NoMatch Then
MsgBox "No Match"
Else
bkmk = Me.RecordsetClone.Bookmark
Me.Recordset.Bookmark = bkmk
End If
End Sub
Then I changed it (to search in many fields)
Me.RecordsetClone.FindFirst "Brand Like " _
& Chr(34) & Me.txtSearch & "*" & Chr(34) " _
& "OR Contact Like " _
& Chr(34) & Me.txtSearch & "*" & Chr(34) " _
& "OR Address Like " _
Chr(34) & Me.txtSearch & "*" & Chr(34) "
It says Syntax error:
Help Please
Thank you in Advanced
The original code is which is working (it searches the specified field)
Private Sub cmdSearch_Click()
Dim bkmk As Variant
Dim strField As String
Me.RecordsetClone.MoveFirst
'Find the first record that matches what
'is in the search text box.
Me.RecordsetClone.FindFirst "Brand Like" _
& Chr(34) & Me.txtSearch & "*" & Chr(34)
If Me.RecordsetClone.NoMatch Then
MsgBox "No Match"
Else
bkmk = Me.RecordsetClone.Bookmark
Me.Recordset.Bookmark = bkmk
End If
End Sub
Then I changed it (to search in many fields)
Me.RecordsetClone.FindFirst "Brand Like " _
& Chr(34) & Me.txtSearch & "*" & Chr(34) " _
& "OR Contact Like " _
& Chr(34) & Me.txtSearch & "*" & Chr(34) " _
& "OR Address Like " _
Chr(34) & Me.txtSearch & "*" & Chr(34) "
It says Syntax error:
Help Please
Thank you in Advanced