import text file

M

Martin

OK, I have a text file that I receive every month via
email, I would like to import this text file into an
access table. The text file is tab delimited and not all
fields have data some are blank. How can I import this
file into an access table, I currently drop the file into
my C:drive after I receive it from my email.

help,
Martin
 
M

Marshall Barton

Martin said:
OK, I have a text file that I receive every month via
email, I would like to import this text file into an
access table. The text file is tab delimited and not all
fields have data some are blank. How can I import this
file into an access table, I currently drop the file into
my C:drive after I receive it from my email.


Use the TransferText method (see Help for details).
 
P

Peter Hoyle

OK, I have a text file that I receive every month via
email, I would like to import this text file into an
access table. The text file is tab delimited and not all
fields have data some are blank. How can I import this
file into an access table, I currently drop the file into
my C:drive after I receive it from my email.

File>Get External Data>Import

Select 'Files of type' text files and select your file.
Select Advanced and set up the necessary parameters e.g. delimiter = tab.
Save your specification.

If you then want to automate the process you can use the 'file open'
dialogue from the Access Web
and then in code use something like
DoCmd.TransferText acImportDelim, "MySavedSpecification", "MyTable", MyFile,
True


Cheers,
Peter
 
H

Henry Smith

I have an application where I perform an import of a text file on a routine
basis. The text file is the source of data for the application. The
operator clicks the "Import" button and an open file dialog asks the
operator to select the text file that needs to be imported. I then place
the data into a temporary table (import function does not append records),
perform test to make sure the text file data is correct. If all checks out
then I perform an "Insert Into" type query to append the data to the
permanent table and delete the data from the temporary table making it ready
for the next import process. My application may be a bit more complex than
your requirements (you didn't specify), but it works great. There are a few
procedures you will need and some package of code written to meet your
requirements, but this will be relatively easy. The code listing is to
complex for this forum, but I am willing to share (free) all of it with
anybody that needs this kind of a procedure.
Send an email to (e-mail address removed) requesting the text import
process and I will be happy to correspond with you.
The common dialog class module was taken from the book "Access 2000
Developers Handbook" by Ken Getz, publisher SYBEX. An excellent AC2000
reference.

Cheers,
Henry
 

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