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--"

            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,
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
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