Re: How can I put dictionary-style page headers in an Access report?
- From: fredg <fgutkind@xxxxxxxxxxxxxxx>
- Date: Thu, 23 Aug 2007 10:08:54 -0700
On Thu, 23 Aug 2007 09:50:01 -0700, qumranandy wrote:
My dictionary is formatted as one big table with three columns - the Greek
words at left in Greek alphabetical order, the biblical Hebrew phrase
including the material which the Greek word helps translate at the right, and
in the middle is the Greek phrase that translates the Hebrew if the
translation is not exact. How can I get the dictionary headers at the top?
(First Greek word and last Greek word on the page).
Fincke
"DataGear" wrote:
In word you can use StyleRef to create dictionary-style page headers, but I
can seem to find a way to do the same in an Access Report.
Let's assume the name of the field is "GreekWord".
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
the [GreekWord] control in the header.
Whatever the first record on the page is will be shown in the Header.
To show the last Greek Word in the Page Header requires a little work.
Add a new table to the database.
ID Field (AutoNumber No Duplicates)
FinalGreekWord (Text)
Name the table 'tblPageHeader'
For the first record in the table enter a space (or anything)
in the FinalGreekWord field.
Continue adding records (by adding a space in the FinalGreekWord field
for as many pages as you expect the report to have,
incrementing the ID field by 1 each record.
So if you expect 20 pages, make 20+ records.
(This can be done using code, but that would be another post.)
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 in the Page Header where you
wish to display the final Greek word on the page:
=DLookUp("[FinalGreekWord]","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 FinalGreekWord = " &
Chr(34) & [GreekWord] & Chr(34) & "Where [ID] = " & [Page],
dbFailOnError
Note: The above should be all on one line, or split using the Space
Underscore combination.
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 Greek word on that page.
Then the report is displayed and the DLookUp in the Page Header
control reads the corresponding page name from the table.
Worked fine for me the last time I ran it.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
- Follow-Ups:
- Re: How can I put dictionary-style page headers in an Access repor
- From: qumranandy
- Re: How can I put dictionary-style page headers in an Access repor
- Prev by Date: Re: Counting Number of Min/Max Instances
- Next by Date: Re: Expression too complex?
- Previous by thread: Counting Number of Min/Max Instances
- Next by thread: Re: How can I put dictionary-style page headers in an Access repor
- Index(es):
Relevant Pages
|
Loading