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 -
Can anyone show me what I need to change please?
Many thanks,
Tom
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] & " * "));"
Many thanks,
Tom