Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Importing Files (Access 2000)

    I'm using the following code to import txt files into a table:

    While FileName <> ""
    DoCmd.TransferText acImportDelim, "AccSummImport", "InvoiceSummaries", FolderName & "" & FileName
    FileName = Dir()
    Wend

    Is it possible to include an ID field as part of the creation of the table?

    As soon as the code is finished it uses the last field (only number field) to index on and this I don't want. Any ideas. I've checked the spec file I don't specify that the import should be indexed on the last field.

    Thanks for the help

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Importing Files (Access 2000)

    Select Tools | Options...
    Activate the Tables/Queries tab.
    The 'AutoIndex on Import/Create' box can contain a list of prefixes/suffixes for field names to be indexed automatically. By default, all field names starting or ending with (for example) 'ID', 'code' or 'number' are indexed. If you don't want this, clear the box and click OK.

    If you create the target table before importing the text files, you can include an AutoNumber ID field. Make sure in the import specification that you don't try to populate the AutoNumber field.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2001
    Location
    Cape Town, South Africa, South Africa
    Posts
    399
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Importing Files (Access 2000)

    Thanks it works great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •