Dim searchvar As String
Dim sbookmark As String

searchvar = Text1
searchvar = Trim$(searchvar)
If searchvar <> " " Then
    With Data1.Recordset
        sbookmark = .Bookmark
        .FindFirst "ACCOUNT NO like'" + searchvar + "*'"

        If .NoMatch Then
            MsgBox " No Record Found "
            .Bookmark = sbookmark
        End If

    End With
End If

It keeps saying "syntax error (missing operator) in expression" and higlighting .FindFirst "ACCOUNT NO like'" + searchvar + "*'". What do you thing is the missing operator? pls i need help for my project.
Thank you:)

Hi

Your field name should be enclosed in square brackets as it contains a space: .Findfirst "[ACCOUNT NO] LIKE '" & searchvar & "*'"

HTH

commented: THANK YOU VERY MUCH SIR! I APPRECIATE YOUR HELP :D +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.