473,395 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Crosstab report with dynamic column headings

I have copied code from the MS Knowledge Base that produces the above
report. I understand the code and am pretty comfortable working with
recordsets. I used the same report structure successfully with Access2
some years ago.

The only real changes I have made to the sample were made to accommodate
a larger number of columns and to display a blank string instead of 0
(having saved the value for totals).

BUT there is clearly something wrong

My code loops through the OnFormat event without proceeding to the
OnPrint event until the last record. This produces an odd result
because the report prints the last record a number of times equal to the
number of records it should print. ie. a report from a query that
produces 531 lines of information has the last record printed 531 times.

I am guessing there is something I dont know that is more likely to be
related to the underlying structure of the report rather than the lines
of code.

Any clues gratefully received.
gus

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
1 4101
Gus:

It is hard to know exactly what might be causing the issue without seeing
the code (yes I am familiar with dynamic crosstabs and have created them
based on the KB article).

That being said, one potential cause of your issue would be in the
ReportHeader_Format event. The following line of code in that event, if not
present, can cause the symptoms you are experiencing.

rstReport.MoveFirst

The following subroutine is from the MS KB article at
http://support.microsoft.com/default...b;en-us;328320.

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)

' Move to first record in recordset at the beginning of the report
' or when the report is restarted. (A report is restarted when
' you print a report from Print Preview window, or when you return
' to a previous page while previewing.)
rstReport.MoveFirst

'Initialize variables.
InitVars

End Sub

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
"gus kernot" <gu*@opr.com.au> wrote in message
news:54*****************@news.uswest.net...
I have copied code from the MS Knowledge Base that produces the above
report. I understand the code and am pretty comfortable working with
recordsets. I used the same report structure successfully with Access2
some years ago.

The only real changes I have made to the sample were made to accommodate
a larger number of columns and to display a blank string instead of 0
(having saved the value for totals).

BUT there is clearly something wrong

My code loops through the OnFormat event without proceeding to the
OnPrint event until the last record. This produces an odd result
because the report prints the last record a number of times equal to the
number of records it should print. ie. a report from a query that
produces 531 lines of information has the last record printed 531 times.

I am guessing there is something I dont know that is more likely to be
related to the underlying structure of the report rather than the lines
of code.

Any clues gratefully received.
gus

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: Steve | last post by:
I have looked through the newsgroup for an answer to this but haven't been able to find anything resembling my situation. What I want to do is relatively simple, I think. I have a crosstab...
3
by: Paula | last post by:
I need to do a summary using a crosstab query. The data has a Date field (Not named "Date"). I can do the Row Heading and Value but am having trouble with the Column Heading. The summary Columns...
2
by: deejayquai | last post by:
Hi I'm trying to produce a report based on a dynamic crosstab. Ultimately i'd like the report to actually become a sub report within a student end of year record of achievement. The dynamic...
2
by: Nenad Markovic | last post by:
Hi everybody, When executing a Crosstab Query I see only rows (defined in a row heading) that have values (defined in value field) in at least one column (defined as column headings). How can...
8
by: Penny | last post by:
(Access 2003 Multiuser Split DB, Windows XP Pro) Hi All, I would really appreciate just some basic tips on how to make a Crosstab Form based on a Crosstab Query. The query always has the same...
1
by: John | last post by:
Hi I have a report bound to a crosstab query. The problem is that under different conditions crosstab returns different column headings. This causes problems with binding of fields on report. Is...
8
by: Paul H | last post by:
I want to base a form on a crosstab query. The query shows statistics for a user defined period. The column headings will look something like this: ClientID Month01 Month02 Month03 etc.. ...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.