Roger's Access Library Homepage
Forum Home Forum Home > Roger's Access Library > Roger's Download Samples
  New Posts New Posts RSS Feed - CrossTabReport.mdb (intermediate)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login


Please consider donating $1 per sample downloaded, (find out why here)

CrossTabReport.mdb (intermediate)

 Post Reply Post Reply
Author
Message
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 20 Feb 2008
Status: Offline
Points: 249
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Topic: CrossTabReport.mdb (intermediate)
    Posted: 01 Aug 2008 at 6:08am

Please consider donating $1 per sample downloaded, 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):
CrosstabReport97.zip
Access 2000 DAO (65 KB): CrossTabReport2k.zip

Consider donating $1 per sample downloaded, find out why here.<
Back to Top
Sponsored Links


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down