my first sql statement type mismatch

mikeo1313

Registered User.
Local time
Today, 07:59
Joined
May 27, 2010
Messages
50
hello forum.

I get a runtime error 3464 data type mismatch in criteria expression
when doing this sql:

mysql = "SELECT tblLoads.Ref, tblloads.contents, tblloads.[destination port], tblLoads.Carriers, tblLoads.[Ship Date], tblLoads.[Est Arrival], tblLoads.Brokers, tblBrokers.[ISF email], tblbrokers.[co name], tblcarriers.scac , tblSuppliers.isf INTO tbltemp FROM tblloads, tblcarriers, tblbrokers, tblsuppliers Where tblloads.do = 'yes' order by tblloads.brokers, tblLoads.[Ship Date], tblloads.carriers, tblloads.[destination port] "

DoCmd.RunSQL mysql


I got a variety of different errors while working through this statement's syntax and even didn't include the FROM clause initially.

Yet, this statement still has troubles and I can't find anything else to do with it to make it work.

It general it gets data from 4 different tables and puts it into a new one (tbltemp) , though not previously created but vba ?supposedly? will create it due to the INTO <tablename> thats there.

So for now I'm official stuck, please help, thanks.:confused:
 
What is the data type in the table of tblloads.do?
 
Does your query work if you remove the Into part ie just a select query?
 
Try

Where tblloads.do = True
 
what can possibly be wrong with this, it follows the form of a code sample.

tbltemp is from select statement in original post.

rs.Open "select * from tbltemp , , adOpenDynamic, adLockOptimistic"

I get
run-time error '-2147217900 (80040e14)': in from clause
 

Users who are viewing this thread

Back
Top Bottom