Print Page | Close Window

CrossTabReport.mdb (intermediate)

Printed From: Roger's Access Library
Category: Roger's Access Library
Forum Name: Roger's Download Samples
Forum Description: A compendium of Microsoft Access 97 and 2000+ routines, each separated into its own sample database.
Printed Date: 22 Oct 2020 at 7:37pm
Software Version: Web Wiz Forums 12.03 -

Topic: CrossTabReport.mdb (intermediate)
Posted By: Roger Carlson
Subject: CrossTabReport.mdb (intermediate)
Date Posted: 01 Aug 2008 at 6:08am

Please consider donating $1 per sample downloaded, - find out why here .


The problem with crosstab queries has always been that if you try to make a report based on one, you inevitably have problems with field names when the crosstab changes. This sample demonstrates how you can get around this problem.

Every time the report is run, there is code in the report which takes the values from the crosstab queries and writes them into a "generic" query which has field names like "Field1, Field2, and so on". This allows you to base your report names on these generic names and step through them in code.

Both of the reports below have the same record source: "qryCrossTabReport", yet they have differing numbers of rows and columns. When the report is run, it takes data from the appropriate query and transforms it into qryCrossTabReport. See the code behind each report for details.
Access 97 (38 KB): -
Access 2000 DAO (65 KB): -

Consider donating $1 per sample downloaded," rel="nofollow - find out why here .<

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 -
Copyright ©2001-2019 Web Wiz Ltd. -