Importing Textfiles

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to set up a macro that imports data from a text file using one of
the Import Specifications I have set up.
When it imports, I want Access to add a primary key (just as it would if you
mannually went through the Import Wizard where it adds a column at the far
left with each row numbered).
Is there anyway to set this up? Would it be done in the Specs part of the
macro part?

Thanks.
 
Create the table into which you want the data to be imported. Ensure that
there is a field for each data item in the text file to be imported. Then
add one more field as the "last" field, and set it to Autonumber type, and
then make it the primary key.

Then have TransferText import to this table. Because the last field is not
in the text file, it'll be ignored by ACCESS, but it will function as the
autonumber / primary key field that you want.
 
Back
Top