Import Text File

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hello, my question is - How do I import a text file into
access and create a table out of it? For example I'm
currently emailed a text file called "NewRecords" the file
is tab delimited what I do is drop it into my C: drive,
what I would like is to create some kind of command button
in my form "frmRecords" that imports this text file into
Access? Any suggestions would be helpful.
 
Look at the TransferText method in the Help file. All it takes is this code
behind your button:

DoCmd.TransferText ..........................
 
One other thing I would add and that is to create an
import Spec for the TXT file. It makes column
associations/names and data formats a lot cleaner.

Once you go through the steps to import the TXT file right
before you click on finished click on the Options button
There you can create/define an import Spec. All of the
option defined i.e. first row contains column titles, data
types, which columns to import etc. will be saved and can
be recalled using the docmd.importtext command.

HTH
 
Back
Top