Transfertext for importing text files without need for a specification

K

Karen Middleton

Hello All

I am using the following macro to import any csv file into any
existing table in Access.

Function ImportTable(tablename As String, filename As String)
DoCmd.TransferText acImportDelim, "CSVEXPORT", tablename, filename
End Function



But the TransferText seems to need a Specification name which is
CSVEXPORT I created but specifications are specific to a particular
table can somebody please suggest to me how I can create a generic
specification that can import a given csv file into a any table
needed. I do not want to build one specification for each table.

Please advise how I can do this.

Thanks in advance
Karen
 
C

Chris Reveille

Specification names are not specific to a particular table
but the table structure must have all the field names
referenced in the specification and the file structure must
also be the same.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top