troubleshooting Question

Access 3067 error using VBA sql

Avatar of j e
j e asked on
Microsoft AccessVBASQL
8 Comments1 Solution112 ViewsLast Modified:
I keep getting 3067 error when running sql in vba.  "Query input must contain at least one table or query."

I'm running code that will generate multiple tables based upon values in another table.  

I cloned code from another module that works fine and just replaced the table name and variable.  So -- I'm not sure why this doesn't work.

st_tablename = "t_PLINE_x-x--"
st_PROFILE = PLINEx-x--

            stsql = "SELECT t_File4_for_review_PLINE2.* INTO " & st_tablename & _
                    " FROM t_File4_for_review_PLINE2 " & _
                    " WHERE (((t_File4_for_review_PLINE2.[PROFILE3])=" & "'" & st_PROFILE & "'" & " ));"

Attached is translated sql.

I've looked through some of the solutions online -- and yes I have a space before the 'From' statement.

What am I missing?

Thanks for your help,
je
Access-3067----sql.png
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros