473,508 Members | 2,250 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Index At The Top Of Pages In Report

I'm working on a report for an existing database. The report will be a
directory of over 500 employees and thus multiple pages. What do I need to
do to show the first employee and the last employee on each page at the top
of each page? For example,
on page 2: Clinton to Kennedy
on page 5: McCain to Obama

Thanks!

Steve
Nov 7 '08 #1
2 2521
On Fri, 7 Nov 2008 16:11:35 -0500, Steve wrote:
I'm working on a report for an existing database. The report will be a
directory of over 500 employees and thus multiple pages. What do I need to
do to show the first employee and the last employee on each page at the top
of each page? For example,
on page 2: Clinton to Kennedy
on page 5: McCain to Obama

Thanks!

Steve
The PageHeader has access to the first detail record.
So to show the first record on each page all you need do is to place
a control bound to the EmployeeName field in the header.
Whatever the first detail record on the page is will be shown in the
Header.

To show the last name in the Page Header requires a little work.
Add a new table to the database.
ID Field (AutoNumber No Duplicates)
FinalName (Text)
Name the table 'tblPageHeader'

For the first record in the table enter a space (or anything)
in the FinalName field.
Continue adding records (by adding a space in the FinalName field
for as many pages as you expect the report to have,
incrementing the ID field by 1 each record.
So if you expect 500 pages, make 500+ records.
(This can be done using code, but that would be another post.)
You now have a table with over 500 records and the [ID] numbers are 1
to up to the number of records you have added.

In the Report, add a control to compute [Pages].
If you don't already have one
= [Page] & " of " & [Pages]
will do.

Then add a control to the Page Header where you
wish to display the final name on the page:
=DLookUp("[FinalName]","tblPageHeader","[ID] = " & [Page])

The Page Footer has access to the last Detail record.
Code the Report's PageFooter Format event:

CurrentDb.Execute "Update tblPageHeader Set FinalName = " & Chr(34) &
[EmployeeName] & Chr(34) & "Where [ID] = " & [Page], dbFailOnError

Run the report.
The [Pages] control forces the report to be formatted twice.
On the first pass, the table is updated after each page with the final
Employee name on that page.
Then the report is displayed and the DLookUp in the Page Header
control reads the corresponding page name from the table.

No need to delete any of the values in the table. The next time you
run the report, new values will simply replace existing ones.

Change [EmployeeName] to whatever the actual name of that field is.
Add error handling as needed.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Nov 7 '08 #2

"Steve" <no******@nomsense.comwrote in message
news:f-******************************@earthlink.com...
I'm working on a report for an existing database. The report will be a
directory of over 500 employees and thus multiple pages. What do I need to
do to show the first employee and the last employee on each page at the
top
of each page? For example,
on page 2: Clinton to Kennedy
on page 5: McCain to Obama

Thanks!

Steve

Can the index can be on the bottom of the page?

Place a unbound text box in the page header.
In the on format event of the page header fill the control with the employee
name
Place a text box in the page footer using the unbound control in the page
header as the source.
Place a 2nd text box in the page footer using the employee name as the
source.
Nov 7 '08 #3

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

Similar topics

10
3660
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
2
10309
by: skura | last post by:
I am trying to understand how the data in sql server is stored and also regarding fill factor and page splitting. 1) My first question what is the difference between Index pages and Data pages....
25
4882
by: sql_server_2000_user | last post by:
Hi, I have a table with about 305 million rows, and a composite primary key that consists of an ascending int and an ascending varchar(18), which is typically of length 13. Even if all the keys...
14
5385
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
1
5159
by: VBSponge | last post by:
Hi all. In A2K i have a report with a control bound to to calculate the page count for the report. I need to retrieve this page count from the report, and build it into a TOC containing this an...
6
4683
by: noway | last post by:
I have greated a report and have included a page break in it. The report breaks were it is supposed to but then it creates a blank page between the two pages. Since this report will print out...
4
3139
by: Mal Reeve | last post by:
Hello, I have a report that has only 2 levels of grouping. The detail section is simply 1 large block for a memo field. I am finding that on some occasions the report errors and generates...
3
2417
by: Vayse | last post by:
I have a report which has several sub reports. Each sub report starts on its own page, and may be 2 or 3 pages long. I'd like to create an index on the first page of the main report. Something...
0
7227
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
7127
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
7331
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
7501
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...
0
5633
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,...
1
5056
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...
0
4713
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...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.