The filter string has the exact same rules as standard SQL, so... you need to concatenate the apostrophes into the filter statement:
objRS.Filter = "contactname = '" & txtSearch.Text & "'"
Also, you probably should run a Replace to deal with any apostrophes in the textbox:
objRS.Filter = "contactname = '" & Replace$(txtSearch.Text, "'", "''") & "'"
HTH,
John Barone
>All,
>
> Below is code I am using to set the filter on a recordset. I am getting the following error and don't know why. The error is: run time error '3001': The application is using arguments that are the wrong type, are out of the acceptable range, or are in conflict with one another.
>
> Here is the code: objRS.Filter = "contactname = " & txtSearch.Text
>
> The contactname field is from a SQL Server Database and is type Char.
>
>Any ideas?
>
>Thanks
>
>Jim