Results 1 to 10 of 10
  1. #1
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69

    Getting data in columns instead of rows of linked table

    I have a Form and a SubForm which have 2 tables associated with them.



    When I build a query linking the 2 tables, the data in the main table comes in multiple rows, each row having the different data of the linked or child table. I want the child table data in separate columns instead of rows and only one row of the parent table for each record

    In the enclosed DB I have 2 tables and one query linking the 2 tables.

    I searched the internet and forum but could not find anything similar which could address this requirement

    Is this feasible?
    Attached Files Attached Files

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    you have three tables in your db, not two you refer to, so no idea which is the 'main' table and which is the 'child' table

    Also no idea which fields you are referring to.

    Would help if you provided the table names you mean, the field names you mean and an example of what you want as an output from one of the records from your 'main' table - use excel if necessary

    So best I can suggest is use a crosstab query

  3. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Can you give us an example of what you want to see displayed for the current "qryFabricTapeConstruction?"
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    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.

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Hi Anil,
    Depending on your needs crosstab query (limited to the current record loaded in the main form as if you try to build one based on the whole tables you cant because you exceed the number of allowable fields) or a field concatenating the codes - see the SimpleCSV() function:
    http://www.accessmvp.com/thedbguy/co...itle=simplecsv
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69
    Quote Originally Posted by CJ_London View Post
    you have three tables in your db, not two you refer to, so no idea which is the 'main' table and which is the 'child' table

    Also no idea which fields you are referring to.

    Would help if you provided the table names you mean, the field names you mean and an example of what you want as an output from one of the records from your 'main' table - use excel if necessary

    So best I can suggest is use a crosstab query
    Thank you for your response and I am sorry for the incomplete information. I have enclosed an Excel sheet for the template of the Query output. The brief explanation of the relationships of the 3 tables is as under:

    1. tblFabricCodeMaster_New This is the primary table which has the fabric codes. Each fabric can be made with a maximum of 6 types of tapes
    2. tblFabricTapeCons_New - This table has the Bill of Material of tapes used to make the fabric. it has the Tape codes id and its location (Wp1, Wp2..). These 6 locations for the tapes are shown in the Excel file
    3. tblTapeCodeMaster - this has the Tape Internal codes which we want in the query under the 6 locations of the tapes

    I am not familiar with the crosstab queries and will appreciate if you help me out with this query
    Attached Files Attached Files

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Why don't you respond to the answer provided in your other thread?
    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.

  8. #8
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    because you are cross posting and an answer has been provided in the other thread plus a further example in this thread, I don't see the point of spending further time on this question

  9. #9
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69
    Quote Originally Posted by CJ_London View Post
    because you are cross posting and an answer has been provided in the other thread plus a further example in this thread, I don't see the point of spending further time on this question
    Thank you. Have seen the other post

  10. #10
    Anil Bagga is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Apr 2020
    Posts
    69
    Quote Originally Posted by Gicu View Post
    Hi Anil,
    Depending on your needs crosstab query (limited to the current record loaded in the main form as if you try to build one based on the whole tables you cant because you exceed the number of allowable fields) or a field concatenating the codes - see the SimpleCSV() function:
    http://www.accessmvp.com/thedbguy/co...itle=simplecsv
    Cheers,
    Thank you Vlad. Beyond my comprehension unfortunately.

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

Similar Threads

  1. Replies: 15
    Last Post: 09-18-2020, 09:59 AM
  2. Moving data from rows into columns
    By Guitarzan in forum Access
    Replies: 1
    Last Post: 08-07-2019, 07:38 AM
  3. Replies: 2
    Last Post: 07-30-2019, 01:56 PM
  4. Transpose Data from Rows to Columns
    By Crdmster in forum Queries
    Replies: 1
    Last Post: 08-08-2017, 02:18 PM
  5. Table rows to columns
    By Rhino373 in forum Programming
    Replies: 5
    Last Post: 12-22-2011, 01:44 PM

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