Data type mismatch in criteria expression

scoob8254

Registered User.
Local time
Today, 13:43
Joined
Mar 2, 2008
Messages
76
hello i get this error "Data type mismatch in criteria expression" with the code below

mySQL = "SELECT tblCatch.tblSpecies, tblCatch.tblBait, tblCatch.Image, tblCatch.tblReturned, tblCatch.tblSize"
mySQL = mySQL + " FROM tblCatch"
mySQL = mySQL + " WHERE (((tblCatch.tblTripId)=' & strTripid & '))"

ive tried changing the data types etc but cant get it to work, not sure what im doin wrong if anybody can help, i would have prefered to have it like this

mySQL = "SELECT tblCatch.tblSpecies, tblCatch.tblBait, tblCatch.Image, tblCatch.tblReturned, tblCatch.tblSize"
mySQL = mySQL + " FROM tblCatch"
mySQL = mySQL + " WHERE (((tblCatch.tblTripId)=[tblTripid]))"

but when i refer to the field directly in the criteria it always returns a result as if theirs no criteria, ie shows results with all tripids not just the one i wanted, this happened on a similar peice of code earlier in the form, but soon as i used a variable it worked fine..


their must be something fundamental im missing and need to understand,
any help appreciated
craig
 
Try

mySQL = mySQL + " WHERE (((tblCatch.tblTripId)=" & strTripid & "))"
 
thanks for the reply pbaldy,

seems i double posted somehow, not sure how tho, my question was answered in the other thread, but thanks for the reply, as usual you guys are as helpfull as ever
 

Users who are viewing this thread

Back
Top Bottom