query error

G

Guest

I have the following behind a form button:

Dim strSQL3 As String
strSQL3 = "INSERT INTO tbl_history([Loan Acct #], status, PopEnterDt " _
& "[chg off date], [loan status], [inventory status], [active bk flag],
[active inactive flag], " _
& "[paid off?], [payoff date], [days delinquent], [amended this mo?],
[extended this mo?]) " _
& "SELECT tbl_history2.[Loan Acct #], tbl_history2.status, " _
& "tbl_history2.PopEnterDt, " _
& "tbl_history2.[chg off date], " _
& "tbl_history2.[loan status], " _
& "tbl_history2.[inventory status], " _
& "tbl_history2.[active bk flag], " _
& "tbl_history2.[active inactive flag], " _
& "tbl_history2.[paid off?], " _
& "tbl_history2.[payoff date], " _
& "tbl_history2.[days delinquent], " _
& "tbl_history2.[amended this mo?], " _
& "tbl_history2.[extended this mo?] " _
& "FROM tbl_history2 LEFT JOIN Tbl_history " _
& "ON (tbl_history2.status=Tbl_history.status) AND " _
& "(tbl_history2.[Loan Acct #]=Tbl_history.[Loan Acct #]) " _
& "WHERE (((tbl_history.PopEnterDt) Is Null) OR ((Tbl_history2.status) Is
Null));"
DoCmd.RunSQL strSQL3

but I get a run-time error 3134: Syntax error INSERT INTO statement.

WHY?

thanks in advance,
geebee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DUPLICATE QUERY results 1
duplicate records 3
unwanted duplicate loan account numbers 1
delete query 1
Query Error 2
query speed 5
runtime error 3001 invalid argument error message 2
change to UPDATE query 3

Top