473,545 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Report

Hi,

I created a report in Access.

* The report has 4 labels per page. Label here means the report is
printed multiple times per page, not the label object type.
* Each label uses 75 numbers, records from a table that are used to
populate the caption property of 75 fields (label the object type).
The first label uses the first 75 records, the second label uses the
next 75 records and so on.

To accomplish I wrote some code for the report:

Dim rsRandom As Recordset
Dim CardTotal As Integer
Dim CardCurrent As Integer

Private Sub Report_Open(Can cel As Integer)
Dim D As Database
Set D = CurrentDb
Dim rsSize As Recordset
Set rsRandom = D.OpenRecordset ("SELECT * FROM RandomScores;")
Set rsSize = D.OpenRecordset ("SELECT * FROM RandomCount;")
CardTotal = rsSize![Count] \ 75
CardCurrent = 1
rsSize.Close
End Sub

Private Sub Detail_Print(Ca ncel As Integer, PrintCount As Integer)
Dim I, RowNum, ElementNum As Integer
Dim ObjectName, RowText As String
If CardCurrent < CardTotal Then
Me.NextRecord = False
For I = 0 To 74
RowNum = (I \ 15) + 1
ElementNum = (I + 1) Mod 15
If ElementNum = 0 Then
ElementNum = 15
End If
If RowNum = 5 Then
RowText = "TB"
Else
RowText = RowNum
End If
ObjectName = "Rand" & RowText & "-" & ElementNum
Me.Controls(Obj ectName).Captio n = rsRandom![RandomScore]
rsRandom.MoveNe xt
Next I
Else
Me.NextRecord = True
End If
CardCurrent = CardCurrent + 1
End Sub

To test the report I populated the RandomScores table with 1800
records. The RandomCount query simply returns the size of the
RandomScores table. 1800 records comes out to 24 labels occupying 6
pages. While six pages appear within the print preview, there are
four problems:

* The last two labels repeat themselves. They both use the exact same
75 records.
* The last 75 records in the RandomScores table are not being used.
The data the gets used twice is the second to last batch of 75.
* If I immediately print out the report upon opening it, I get pages 2
through 6.
* If I page through the report and then print it out, I only 1 label,
the last one.

Does anyone have suggestions?
Nov 13 '05 #1
0 1277

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

Similar topics

3
3837
by: Spacy | last post by:
Am creating a HTML Report in asp.net. To save this report to excel on client-side, i write this code: Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("content-disposition", "attachment; filename=Report.xls") But once the report is saved in excel, on click of hyperlink for second html report, i dont get the second...
3
6290
by: ChrisWinterscheid | last post by:
We are running DB2 8.1 on AIX 5.2. DB2level shows: DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL08016" with level identifier "02070106". Informational tokens are "DB2 v8.1.1.56", "s040616", "U497635", and FixPak "6". Product is installed at "/usr/opt/db2_08_01".
0
6457
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the report are based on the same View addressed in the Record Source of both as 'dbo.CLMain_vw'. The View resides in a SQL Server 2000 database. There are...
4
2795
by: Trevor Best | last post by:
I have a report that's fairly simple, page headers and footers, detail has a subreport in (can vary in length). The customer wanted a signature block for them, their client and 3rd party. This was no problem, couple of boxes and labels in the report footer. Now customer wants this signature block on the foot of page 1 (stoopid IMO as that...
0
267
by: Shamin | last post by:
Hi, Thanks in advance for answering to my Question. I'm stuck with this problem and would really appreciate any help. I have 2 aspx files (Main.aspx and ReportViewer.aspx). Main.aspx has a datagrid which is populated with list of report names. When the user click on the name of a report, I display a panel that has a button which on...
12
1679
by: Brad Baker | last post by:
I am trying to write a simple ASP.net/C# page which allows users to select some values and produce a report based on a SQL query. I have a self posting dropdown form which allows users to select the type of report to generate: Select the type of report to display: <form runat="server"> <asp:DropDownList AutoPostBack="true" ID="report"...
0
1162
by: Aryan | last post by:
Hi, I am doing "Export to Excel" functionality, but while doing this I am getting error. Like I have two types of Report, each type has many sub reports inside. So I am opening new window for Each type of report by taking help from Javascript "window.open()" and passing different type of window name. Given below example will help you to...
0
1183
by: Aryan | last post by:
Hi, I am doing "Export to Excel" functionality, but while doing this I am getting error. Like I have two types of Report, each type has many sub reports inside. So I am opening new window for Each type of report by taking help from Javascript "window.open()" and passing different type of window name. Given below example will help you to...
0
1221
by: Aryan | last post by:
Hi, I am doing "Export to Excel" functionality, but while doing this I am getting error. Like I have two types of Report, each type has many sub reports inside. So I am opening new window for Each type of report by taking help from Javascript "window.open()" and passing different type of window name. Given below example will help you to...
8
2443
by: sara | last post by:
I have a report that runs fine with data. If there is no data, I have its NO Data event sending a MsgBox and cancelling the report. Then it seems I still get the 2501 message on the Open Report command, even though I have the code to trap Err 2501 (from many postings - all looked the same to me) on the button the user pressed to get the...
0
7475
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7409
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7664
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7918
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5981
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5341
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4958
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1897
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.