Import Code Problem

C

chloe

Guest
The code works fine below. I need help inserting a tablename argument where it brings in the filename I chose instead of "*" or me coding a
particular filename. I have several files I need to bring in and want them all to keep their name when imported to Access tables.
I am working on this today and really appreciate the help.



Function ImportFile() As Integer


Dim fs As Object
Dim FileSpec As String
Dim strFile As String
Dim tablename As String
Dim i As Integer
'Dim getfilename As String

FileSpec = OpenTextFile("c:\download\")



DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel3, "*", FileSpec, True

ImportFile = 1

End Function
 
Back
Top