Results 1 to 3 of 3
  1. #1
    cewolf is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2013
    Posts
    5

    Creating a report based on crosstab query , variable columns

    Greetings
    i have been searching for a solution for hours ..but with no luck , i would really appreciate a help



    i have a crosstab query that will produce different results based on user's input ....
    so input A will give a query with 3 headings Q1, Q2, Q3
    input B will give a query with 5 headings Q12, Q13, Q14, Q16, Q17
    input C will give a query with 2 headings Q5, Q6
    and so on
    i dont want to create a report for every possible option since i have a LOT of them also the result (headings) of each option will change with time ..

    how can i generate a report that can adjust to the different numbers of columns , fields names and labels

    i understand that the only way to achieve that is via Code, but my coding skills are primitive ... so please try to be more detailed

    thank you very much in advance

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    how can i generate a report that can adjust to the different numbers of columns , fields names and labels

    i understand that the only way to achieve that is via Code, but my coding skills are primitive ... so please try to be more detailed
    if you want a detailed answer, you will need to provide more detail - what does the report look like, what sorting/grouping is required, do you mind having blank columns - i.e. all columns appear but only some are populated. Are you headings really Q1, Q2 etc? What is the full range of potential headings etc.

    Usual way (requires no code) is to set the column heading property of the query for all possible headings (in query design view, select properties and populate the column heading property)

    Alternatively, I think you can do this in 2007. If you are happy with a datasheet view of your data, then open your report in design view and drag the query onto the form or report as a subform/report. The source object of the subform/report control should be 'query.nameofcrosstab'. So no code required and only populated columns will appear

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Just realised cross posted here

    https://www.access-programmers.co.uk...d.php?t=293074

    so I'll leave it to the other forum

    cewolf - recommend you read this link http://www.excelguru.ca/content.php?184

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

Similar Threads

  1. Replies: 1
    Last Post: 02-22-2017, 03:39 AM
  2. Replies: 5
    Last Post: 02-19-2017, 03:44 PM
  3. Replies: 3
    Last Post: 01-01-2014, 01:16 AM
  4. Replies: 4
    Last Post: 01-03-2013, 08:29 PM
  5. Report based on crosstab query
    By pbuecken in forum Reports
    Replies: 7
    Last Post: 01-16-2012, 09:59 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