Type mismatch error (1 Viewer)

eme126

Registered User.
Local time
Today, 02:45
Joined
Jun 2, 2006
Messages
45
:( It says that to get rid of a "type mismatch" error I should add the DAO.lib. But I already had it and I always got the error.

Set oSQL = "SELECT * FROM TableInfo WHERE Caption Like '" & strTarget & "'* "


The last ampersand is the type mismatch.
 

elbweb

Self Taught Hero
Local time
Today, 05:45
Joined
Jul 28, 2006
Messages
126
the star/wildcard should be within the quotes, should it not?

edit: clarification: it should be within the single quotes, i.e. :
Code:
strSQL = "SELECT * FROM tblSomething WHERE Field LIKE '" & strTemp & "*';"

i think that would cause a type mismatch..
 

eme126

Registered User.
Local time
Today, 02:45
Joined
Jun 2, 2006
Messages
45
Thank you :)
 

Users who are viewing this thread

Top Bottom