By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Run-time error'-2147217900(80040e14)': in vba access 2003

P: 23
I craft a access vba code.
I got this error message while trying to run:
Run-time error'-2147217900(80040e14)':
The SELECT statement includes a reserved word or an argument name thht is misspelled or missing,or the punctuation is incorrect.
The SQl code is"
Expand|Select|Wrap|Line Numbers
  1. strSQL = "SELECT " & strFldname & _
  2.                         "INTO " & strTempTable & _
  3.                         "FROM " & strLftTableName & _
  4.                         "LEFT JOIN tablename " & _
  5.                         "ON (tablename_SP.Fieldname = " & strLftTableName & ". fieldname) " ' " & _
  6.                         "ORDER BY Login ASC,UserName"
Mar 28 '12 #1

✓ answered by mshmyob

Try putting spaces before the words INTO, FROM,and LEFT.

Also I wonder if in your LEFT JOIN part of the statement if 'tablename' is really the name of your table? If so that is a bad name for a table name.

To see what is wrong with the syntax just popup a message box with the strSQL variable and you can easily see what Access sees.

cheers.

Share this Question
Share on Google+
2 Replies


mshmyob
Expert 100+
P: 903
Try putting spaces before the words INTO, FROM,and LEFT.

Also I wonder if in your LEFT JOIN part of the statement if 'tablename' is really the name of your table? If so that is a bad name for a table name.

To see what is wrong with the syntax just popup a message box with the strSQL variable and you can easily see what Access sees.

cheers.
Mar 28 '12 #2

NeoPa
Expert Mod 15k+
P: 31,186
Please refer to How to Debug SQL String. This is a very common error which would be avoided if only a little thought is invested prior to posting your question.

Mshmyob is perfectly correct of course. This doesn't reflect on the answer, just that you asked the question the way you did. Please check that link before posting again.

PS. Clearly you didn't get the error message from running that line of code as that line simply creates a string and assigns it to a variable. The error message is for another line where an attempt is made to execute the SQL within that string. How anyone can imagine that posting such a question without showing the contents of the string makes any sense is beyond me.
Mar 28 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.