Mac M
asked on
Import into Access Table from Excel
How do I create an Import Table in Access for a monthly raw (May, June, etc) data tab in Excel that I can use monthly to capture the new raw_data?
ASKER
Good morning Dale, do you have a code to import from Excel and append to an existing table in Access that will not allow duplicates and error handling. My code has a error at line:
'If FileExist(filepath). thanks for your support...
Private Sub Command665_Click()
Dim filepath As String
Dim User As String
User = Environ("username")
filepath = "T:\Users\" & User & "\Documents\Test2.xlsx"
If FileExist(filepath) Then
DoCmd.TransferSpreadsheet acImport, , "TblTest", filepath, True
Else
MsgBox "File not Found. Please check filename or file location. Contact Administrator"
End If
End Sub
'If FileExist(filepath). thanks for your support...
Private Sub Command665_Click()
Dim filepath As String
Dim User As String
User = Environ("username")
filepath = "T:\Users\" & User & "\Documents\Test2.xlsx"
If FileExist(filepath) Then
DoCmd.TransferSpreadsheet acImport, , "TblTest", filepath, True
Else
MsgBox "File not Found. Please check filename or file location. Contact Administrator"
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Dale for the awesome and thorough help...
So the first step would be to use the Transfer Spreadsheet method to link the worksheet into Access