Could someone show me why I'm getting an "invalid procedure call" error (no error number) on the following:
Code:
SELECT Mid([tblAccountsTEST].[Account],InStr(1,[tblAccountsTEST].[Account],"qq"),6) AS Expr1
FROM tblAccountsTEST, tblQuickenToAccess
WHERE ([tblAccountsTEST].[Account] like Mid([tblQuickenToAccess].[AcctName],InStr(1,"'" & [tblQuickenToAccess].[AcctName] & "'","qq"),6) );
The fields [Account] and [AcctName] are text. In case it matters, tblQuickenToAccess is linked to a text file.
Thx, Ron
EDIT - The following gives "data type mismatch in criteria expression" even though both fields are text.
Code:
SELECT Mid([tblAccountsTEST].[Account],InStr(1,[tblAccountsTEST].[Account],"qq"),6) AS Expr1
FROM tblAccountsTEST, tblQuickenToAccess
where Mid([tblAccountsTEST].[Account],InStr(1,[tblAccountsTEST].[Account],"qq"),6) = Mid([tblQuickenToAccess].[AcctName],InStr(1,[tblQuickenToAccess].[AcctName],"qq"),6)
;
EDIT - Looks like I forgot to trap for null values. Concatenating the fields in the last query with "" seems to work. Still testing.