Results 1 to 13 of 13
  1. #1
    derekben is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jul 2013
    Posts
    11

    Converting Rows to Columns and Columns to Rows

    Hello everybody,


    I have been struggling with this for awhile now. I am trying to convert a table that looks like the following...

    Customer Name SumofSum of Bill Rate Reviewer
    000462 John 500 Mike
    000224 Mike 900 Jeff


    I would like to covert it to....

    Customer 000462 000224
    Name John Bill
    SumOfSum.. 500 900
    Reviewer Mike Jeff



    I don't think Access has any functions for this but I am not 100% sure. I know this can be done in a Module but I am not sure of how to code it. Any help is much appreciated. Thanks.

  2. #2
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Have you tried a Crosstab query?

  3. #3
    derekben is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jul 2013
    Posts
    11
    Yes. The issue with the crosstab table query is that each name does not have data for every customer. I do not want to show blank cells, because this go straight to a form. I only want to show the Name and only customers they have worked on.

    It is difficult to explain, if you have any more questions or need more information please let me know. Thanks!!!

  4. #4
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    If the information is going straight to a form, why not query the table as is filtering out the blank fields as necessary, then arrange the fields like you want to display them on the form?

  5. #5
    derekben is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jul 2013
    Posts
    11
    We ran the crosstab query and have Customer, Name , SumofSum of Bill Rate, Reviewer as our headers but when it displays in the form, it shows up as rows instead of columns. What I am really trying to figure out is how to transpose rows into columns in the easiest possible way. Thanks.

  6. #6
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Can you share your database for further analysis? Just make a copy, remove all important data, add one line of example data, and upload then post.

  7. #7
    derekben is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jul 2013
    Posts
    11
    It won't let me upload it here. Can I email it to you or is there another way to upload?


    Thanks

  8. #8
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Try compacting and repairing the database then zipping it.

  9. #9
    derekben is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jul 2013
    Posts
    11

    Attachment

    Performance Assessment.zip Here is the zip file. Thanks

  10. #10
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Thanks. Are you trying to get the information into a report for analysis or a form for further data entry?

    EDIT

  11. #11
    derekben is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jul 2013
    Posts
    11
    Form for further data entry.

  12. #12
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    See if Form 2 gets you what you are looking for.

    The problem with saving your data as you were noting in your original post is that you would have to create a new field for each customer. The way I set Form 2 up is it is not tied to your main data table, but it will write to it. The layout appears vertically using the 'Stacked' arrangement. I also went through the your main data table and removed the spaces from the field names. In Access, it is bad practice to have spaces in your titles for both field names and table names. I also changed 'Name' to 'TName' since Access uses 'Name' which could cause you problems in the future.

    If it is about what you are looking for and you want to change the form name, make sure you change the form name call in the VBA I wrote in. The green font wording are notations I made throughout the code, in case you are not familiar with VBA.
    Attached Files Attached Files

  13. #13
    derekben is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jul 2013
    Posts
    11
    Thanks!!! That's exactly what I was looking for.

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

Similar Threads

  1. How do I get totals for rows and columns?
    By Nick Lingenfelter in forum Reports
    Replies: 3
    Last Post: 03-01-2013, 10:11 AM
  2. Rows to columns
    By zaffar_mughal in forum Access
    Replies: 1
    Last Post: 12-03-2012, 01:18 PM
  3. Rows to columns
    By Jim.H. in forum Access
    Replies: 1
    Last Post: 01-28-2012, 05:29 PM
  4. Rows into Columns
    By chrisdavis in forum Programming
    Replies: 16
    Last Post: 12-22-2011, 01:58 PM
  5. Combining columns into rows
    By steeveepee33 in forum Queries
    Replies: 5
    Last Post: 04-30-2009, 09:18 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