Results 1 to 3 of 3
  1. #1
    dmoro6 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    3

    Table with multiple like fields that I need to display into an Array-like format

    Hi all,


    I have a table that contains the following;

    Company name, PositionID, Firstname1, Lastname1, title1, gender1, Firstname2, Lastname2, title2, gender2, Firstname3, Lastname3, title3, gender3 [...up to 50 names]

    The data is uploaded to my table from a 3rd party database source via .csv file.

    I can capture up to 50 names, titles and gender per record. I would like to display this data in a table/array like format. I'm not too good at VBA but I can use expressions for unbound fields.

    I have attached a file that shows the data in a format I would like to see in Access displayed in a form.

    If this must be done in a multi step process, that's okay too.

    David
    Attached Thumbnails Attached Thumbnails Sample Display.jpg  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    A UNION query could manipulate the records into the normalized structure. UNION query has a limit of 50 lines. Also, VBA to open recordset from UNION query does not work (at least wouldn't for me). There is no wizard or designer for UNION, must type into the SQL View window of Query Designer. Be grateful for copy/paste (Ctrl+C/Ctrl+V).

    SELECT [Company name], PositionID, Firstname1 As Firstname, Lastname1 As Lastname, title1 As Title, gender1 As Gender FROM tablename
    UNION SELECT [Company name], PositionID, Firstname2, Lastname2, title2, gender2 FROM tablename
    UNION SELECT [Company name], PositionID, Firstname3, Lastname3, title3, gender3 FROM tablename
    ...
    UNION SELECT [Company name], PositionID, Firstname50, Lastname50, title50, gender50 FROM tablename;

    Then either save the records to a 'master' table in normalized structure or just work with the UNION query as a data source.

    To append records to 'master' (assumes fieldnames in master are same as those in the UNION query):
    INSERT INTO Master SELECT * FROM Query1;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    dmoro6 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    3
    Thanks for the tip June7!!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. display multiple fields combo box
    By statty01 in forum Access
    Replies: 5
    Last Post: 07-03-2013, 05:29 PM
  2. retrieve table contents from an array
    By bonecone in forum Programming
    Replies: 1
    Last Post: 05-22-2012, 12:51 PM
  3. Replies: 2
    Last Post: 09-29-2011, 12:50 PM
  4. Replies: 3
    Last Post: 08-16-2011, 02:20 PM
  5. Replies: 3
    Last Post: 08-02-2009, 03:52 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums