This is mean. I have code behind a form that runs action queries (make-table, append, ...) to automate about 30 steps. One section of code includes an ADO recordset open statement that executes an Insert Into SQL query:
Here's a snipet (after dim'ing etc.):
Set con = New ADODB.Connection
con.Open CurrentProject.Connection
Set rs1 = New ADODB.Recordset
strQuery = "INSERT INTO CumCosts SELECT * FROM UpdatedBCIV-IROverheadAmt;"
rs1.Open strQuery, con, , , adCmdText
I get error "Syntax Error in From Clause". I have checked that the two tables have identical fields (number of fields, names and data types of fields all same).
Other steps I've done to troubleshoot:
1) Just before executing this rs1.Open line of code, I leave the VBA and check the above table named "Updated..." and there is one (1) record in it just waiting to be appended - seems ready.
2) I even commented out all the above code related to programmically appending, and then when get to this point in the code, I leave VBA and run the identifcal append query created from Query Design grid and it works fine. Then I come back to VBA section and proceed to end of sub.
3) I have a section of code in same subroutine that does exactly the same Insert Into (into the same table, but from a different table, but again with all the same fields).
Any help or suggestions greatly appreciated.
Jeff
Here's a snipet (after dim'ing etc.):
Set con = New ADODB.Connection
con.Open CurrentProject.Connection
Set rs1 = New ADODB.Recordset
strQuery = "INSERT INTO CumCosts SELECT * FROM UpdatedBCIV-IROverheadAmt;"
rs1.Open strQuery, con, , , adCmdText
I get error "Syntax Error in From Clause". I have checked that the two tables have identical fields (number of fields, names and data types of fields all same).
Other steps I've done to troubleshoot:
1) Just before executing this rs1.Open line of code, I leave the VBA and check the above table named "Updated..." and there is one (1) record in it just waiting to be appended - seems ready.
2) I even commented out all the above code related to programmically appending, and then when get to this point in the code, I leave VBA and run the identifcal append query created from Query Design grid and it works fine. Then I come back to VBA section and proceed to end of sub.
3) I have a section of code in same subroutine that does exactly the same Insert Into (into the same table, but from a different table, but again with all the same fields).
Any help or suggestions greatly appreciated.
Jeff