+ Reply to Thread
Results 1 to 5 of 5

fields table linking

  1. #1
    Registered User
    Join Date
    10-13-2012
    Location
    newcastle
    MS-Off Ver
    Excel 2007
    Posts
    68

    fields table linking

    Hi.

    I am fairly new to Access. I have been experimenting but not with much luck over this problem.

    I have a .txt file in a folder on my computer. I use access to link to the .txt file. Using the following code.

    Please Login or Register  to view this content.
    The .txt files has rows of data. Most of the rows are the same length,(8 Fields) H
    However some are not and a lot longer than the 8 field.ie 15 fields.
    On linking the .txt file to the database only the first 8 fields show.
    The extra 7 fields fields do not go into the linked table for some reason, the fields are not created in the table.

    I have found that moving the 15 Field row to the top of the .txt file then linking mean that correct number fields are created in the table and all the data shows.

    I am not sure how to get round this problem, can anyone help? Please can you state a step by step instruction on how i would do this..if possible?
    Last edited by squirrely; 09-15-2013 at 09:20 AM. Reason: bad wording

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,811

    Re: fields table linking

    You indicated that you are linking your text file to Access, but your code indicates that you are actually importing the text file. If you are importing you can set the import specifications by first using the import wizard manually and clicking on the advanced button and setting the fields to import. Save the specification and use that in your transfertext line. Additionally, if in your text file, you have a header row (field name), make sure that you identify that also.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-13-2012
    Location
    newcastle
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: fields table linking

    Hello Alan,

    You woudlnt believe it, but i was actually thinking of PM you to have a look at this. Thank you for reading my mind :D

    Yes i went to the import wizard and added extra fields before importing.

    I thought the code was actually linking the files in the folder??? If i was linking the file is it possible to create fields before linking?

  4. #4
    Registered User
    Join Date
    10-13-2012
    Location
    newcastle
    MS-Off Ver
    Excel 2007
    Posts
    68

    Re: fields table linking

    Hey Alan, just used the import wizard but clicking on "Link to the data source......" clicked on advanced added more fields and linked the table. That worked nicely.
    Thanks Alan, If you come to London i owe you a drink!

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,811

    Re: fields table linking

    I'll keep that in mind. Glad that its working.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Linking Multiple Page Fields in Pivot Table
    By dfs3000my in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-02-2010, 05:02 AM
  2. Linking Multiple Page Fields in Pivot Table
    By dfs3000my in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2010, 02:49 AM
  3. How to Disable automatic fields in pivot table like total and count on fields
    By anushka in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-24-2009, 07:53 AM
  4. Differentiate between column fields and data fields in a pivot table
    By whiteheadw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-12-2009, 01:59 PM
  5. Linking pivot table fields
    By damo1888 in forum Excel General
    Replies: 1
    Last Post: 03-21-2007, 11:53 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1