Hi
I found this code that lets the user enter an excel file and then import into access.
End Sub
'Private Sub Command126_Click()
On Error GoTo Err_Command126_Click
Dim strFile As String
strFile = InputBox("What is the name of the file?")
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "MyTableName", _
"f:\" & strFile & ".xlsx", False, "WorksheetName!A1:S200"
End Sub
MyTableName is my access table.
It bombs at "WorksheetName!A1:S200".
The path name to the f drive is to a memory stick.
JAM
I found this code that lets the user enter an excel file and then import into access.
End Sub
'Private Sub Command126_Click()
On Error GoTo Err_Command126_Click
Dim strFile As String
strFile = InputBox("What is the name of the file?")
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "MyTableName", _
"f:\" & strFile & ".xlsx", False, "WorksheetName!A1:S200"
End Sub
MyTableName is my access table.
It bombs at "WorksheetName!A1:S200".
The path name to the f drive is to a memory stick.
JAM