Hi everyone, I have basic level vba programming skills and I am trying to export an Excel table I create to an Access table. I'd like to have the data append to whatever is currently in the table. Eventually I will have an Excel query to retrieve data from Access, make manual changes and update the data in the Access table.
Here is the code I'm trying but I get a sytax error in FROM clause.
Public Sub Update_Pmt_Table()
Set cn = CreateObject("ADODB.Connection")
dbPath = "C:\Users\AlphaCove\Documents\AlphaCoveCda\ACFinan cial\Software\Mortgage_Tool.mdb"
dbWb = Application.ActiveWorkbook.FullName
dbWs = Application.ActiveSheet.Name
scn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath
dsh = "[" & Application.ActiveSheet.Name & "$A10:I12"
cn.Open scn
cn.Execute " INSERT INTO Loan_Int_Schedule " _
& "SELECT * " _
& "FROM " & dsh & " ;"
cn.Close
End Sub
Excel Table (Sheet: "Loan_Pmt_Generator")
FILE NUMBER COUPON DATE MONTHLY INTEREST DATE RECEIVED AMOUNT RECEIVED COUPONS REMAINING DEFAULT TRIGGER DEFUALT NOTICE DATE 126Syke20160411 11/05/2016 2,770.83 11 126Syke20160411 11/06/2016 2,770.83 10 126Syke20160411 11/07/2016 2,770.83 9 126Syke20160411 11/08/2016 2,770.83 8 126Syke20160411 11/09/2016 2,770.83 7
Access Table (Access DB:"Mortgage_Tool.mdb")
Any help would be greatly appreciated...Thanks in advance.
ID ,File_Num ,Cpn_Pmt_Date ,Cpn_Pmt ,Date_Recd ,Amt_Recd ,Cpn_Remain ,Default_Trigger ,Default_Not_Date