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.
URL: www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=362
Printed Date: 13 Nov 2019 at 7:10am


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, http://www.rogersaccesslibrary.com/whydonations.htm - find out why here .

CrossTabReport.mdb

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.
 
Download
Access 97 (38 KB):
http://www.rogersaccesslibrary.com/forum/uploads/5/CrosstabReport97.zip - CrosstabReport97.zip
Access 2000 DAO (65 KB):  http://www.rogersaccesslibrary.com/forum/uploads/5/CrossTabReport2k.zip - CrossTabReport2k.zip



-------------
Consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm" rel="nofollow - find out why here .<



Print Page | Close Window