• Report based on crosstab query (2003 sp2)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Report based on crosstab query (2003 sp2)

    Author
    Topic
    #439784

    I have a report based on a crosstab query with ‘month’ as a column heading in the query. The query displays as many months as the data reports. The report has fields for all twelve months, but gives me errors when all the months are not in the data. Do I have to create the report with code rather than designing it? And if so how would I do that? Or is there another solution?

    Viewing 1 reply thread
    Author
    Replies
    • #1051673

      Does the attached database do what you want, i sourced this fro Hans a while back.

      • #1051778

        Actually Pat, I am going to use both of Hans solutions. The columns headings are sufficient to prevent the error when the report is opened and that’s really all I need, but the dynamic report I have got to do because it facinates me. I will be retiring next year so I will never get past scratching the surface of this stuff, but I have so thoroughly enjoyed it, and you guys are the best.

        Pat, Hans, thanks again.

    • #1051683

      The database Pat attached shows how to create a dynamic crosstab report. If you simply want 12 columns, whether there are data or not, there is a simpler way: specify all 12 months in the Column Headings property of the crosstab query.

      • #1077298

        I found this in the search (wonders will never cease!) as it fits my needs exactly. The only problem I’ve got is that the properties for the Column Headings brings up the Qurey properties. The other fields show their properties though?

        Ideas please.

        • #1077306

          Sorry, I don’t understand. What do you mean by “the properties for the Column Headings brings up the Query properties”?

          • #1077607

            When the properties box is open, & I select the field for Column Headings, the properties box only shows the properties for the query, not the field. All other fields are OK though.

            • #1077610

              Column Headings is a property of the query as a whole, not of an individual field. You can set this property to a comma-separated list of the column headings you want to include in the crosstab query, in the desired order. For example, if the column field for the crosstab query contains regions, you could enter the following in the Column Headings property:

              “North”, “East”, “South”, “West”

              The crosstab query will always use these four column headings, whether there are data for each value or not, and in the specified order instead of the default alphabetic order.

            • #1077612

              Doh! brickwall

              Thank you for your patience.

    Viewing 1 reply thread
    Reply To: Report based on crosstab query (2003 sp2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: