B
Brian Flewwelling
I have a query with Like [FirstLetter] & "*" which works fine when i run it,
but when i put the corresponding SQL code into VBA it returns a Type
Mismatch error.
the query's name is 'qFindME', with the following SQL: it asks for the
parameter value and performs properly)
PARAMETERS Letter Text ( 255 );
SELECT DISTINCT EqRunningLines.HorseName
FROM EqRunningLines
WHERE (((EqRunningLines.HorseName) Like [Letter] & "*"));
While the code:
Set qry = CurrentDb.QueryDefs("qFindMe")
qry.Parameters("[Letter]") = sFirstLetter
Set rst = qry.OpenRecordset
returns Type Mismatch error on the last line (proper dims exist for qry)
And the code:
sSQL = "SELECT EqRunningLines.HorseName FROM EqRunningLines " & _
"WHERE (((EqRunningLines.HorseName) Like " & Chr$(34) & sFirstLetter &
"*" & Chr$(34) & "));"
Set rst = CurrentDb.OpenRecordset(sSQL)
also returns Type Mismatch error on the last line
Help, please
Brian
but when i put the corresponding SQL code into VBA it returns a Type
Mismatch error.
the query's name is 'qFindME', with the following SQL: it asks for the
parameter value and performs properly)
PARAMETERS Letter Text ( 255 );
SELECT DISTINCT EqRunningLines.HorseName
FROM EqRunningLines
WHERE (((EqRunningLines.HorseName) Like [Letter] & "*"));
While the code:
Set qry = CurrentDb.QueryDefs("qFindMe")
qry.Parameters("[Letter]") = sFirstLetter
Set rst = qry.OpenRecordset
returns Type Mismatch error on the last line (proper dims exist for qry)
And the code:
sSQL = "SELECT EqRunningLines.HorseName FROM EqRunningLines " & _
"WHERE (((EqRunningLines.HorseName) Like " & Chr$(34) & sFirstLetter &
"*" & Chr$(34) & "));"
Set rst = CurrentDb.OpenRecordset(sSQL)
also returns Type Mismatch error on the last line
Help, please
Brian