Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Type Mismatch error in query string

$
0
0
Hello, it has been some time since I last used Access.

I have a query string which works fine in a Query, but I need to use the code with a command button on-click event and I am getting a Run Time Error 13 Type Mismatch error because the field "businessID" is numeric, and the field "businessName" is text.

I cant remember how to fix the Type Mismatch error from the code below in VBA -

Code:

Dim strRowSource2 As String
strRowSource2 = "SELECT tblBusinesses.businessID, tblBusinesses.businessName FROM tblBusinesses" & _
"WHERE (((tblBusinesses.businessID) Like " * " & [Forms]![frmSearch]![Text5] & " * ") AND ((tblBusinesses.businessName) Like " * " & [Forms]![frmSearch]![Text5] & " * "));"

Can anyone show me what I need to change please?

Many thanks,

Tom

Viewing all articles
Browse latest Browse all 13329

Trending Articles