Here is my code:
DoCmd.SetWarnings (False)
Dim sql As String
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, TableName.Value, TxtPath.Value, False, "A7:H1000"
sql = "INSERT into DTR(EmpNum, EmpName, eDate, eDay, FIN, FOUT, LIN, LOUT) Select F1, F2, F3, F4, F5, F6, F7, F8 from '" & TableName & "'"
DoCmd.RunSQL (sql)
NOTE: TableName and TxtPath are Textbox in a form.
ERROR: I got some problems with the code above which i colored the font as red. any idea how this logic can be done? What I'm trying to do is after importing an excel file, it will then copy the values from the table created from importing to the DTR table.. please help..