473,386 Members | 1,706 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,386 software developers and data experts.

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(Cancel 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(Cancel 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(ObjectName).Caption = rsRandom![RandomScore]
rsRandom.MoveNext
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 1270

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

Similar topics

3
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",...
3
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...
0
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...
4
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...
0
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...
12
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...
0
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...
0
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...
0
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...
8
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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...

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.