Bilbo_Baggins_Esq
Registered User.
- Local time
- Today, 10:11
- Joined
- Jul 5, 2007
- Messages
- 586
I added this question to another thread I started last week for a different problem, but since that problem has been resolved, I think it might be better to start a new thread with this new problem.
For some reason, this db.execute statement is generating a "Syntax error in FROM clause" error.
I could easily work around it by pulling a record set from the Customer_Info table, applying the values to variables and then simply add a new record to the description table using a new recordset and applying the set variables.
However, it seemed (at the time) to make more sense just to append the data directly to the Description table.
Any ideas why that FROM clause is firing a systax error?
For some reason, this db.execute statement is generating a "Syntax error in FROM clause" error.
Code:
db.Execute _
"INSERT INTO Description ( Customer_Number, Customer_Type_Name, Amount, Down_Payment, Financed_Amount, Interest_Rate, PPY, Payment, Sale_Date, First_Pay_Date) " & _
"SELECT Customer_Info.Customer_Number, Customer_Info.Customer_Type_Name, Customer_Info.Sale_Price, Customer_Info.Down_Payment, Customer_Info.Financed_Amount, Customer_Info.Interest_Rate, Customer_Info.PPY, Customer_Info.Payment_Amount, Customer_Info.Sale_Date, Customer_Info.First_Payment_Date " & _
"FROM Customer_Info " & _
"(((WHERE Customer_Info.[Customer_Number]) = " & Customer_Number_VBA & "));"
I could easily work around it by pulling a record set from the Customer_Info table, applying the values to variables and then simply add a new record to the description table using a new recordset and applying the set variables.
However, it seemed (at the time) to make more sense just to append the data directly to the Description table.
Any ideas why that FROM clause is firing a systax error?