First word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I found this arry code that man can take the last word from Pagefoot to
PageHead.

Dim strLastItems(500) As String
strLastItems(Me.Page) = Me.LName
Me.thetextbox = Me.LName & " - " & strLastItems(Me.Page)

But I tested it and work only when the Text Box option "Not Can Grew" on
Detail.
It give wrong result when The Text Box on Detail option format choose YES to
" Can Grew"

Do you have any ide to fix it such as make compare with every page that view
or something like that, to let give correct result when text box can grew on
Detail?
Because now with this code only few page can give correct result and then it
give
wrong result.
Here is the sample that you can check the report page and see it give only
few page correct then will be give wrong result.

http://home.swipnet.se/georgedesign/dict/first-word.mdb

God Bless
 
Hi again

Here is the URL that how can download the file:

http://w5.nuinternet.com/s650100026/first-word.zip

On this MS Access file you will see two Report
1- is the Report that have option can Graw and Detail "Keep together = NO"
and you see the result of Arry not give correct result.
So my question is about this report.
2- This report it work good cause the Nothing of Field Graw and
even Detail "Keep together = YES".

Hope I get answer for my question

Thanks
 
Hello

I found this arry code that man can take the last word from Pagefoot to
PageHead.

Dim strLastItems(500) As String
strLastItems(Me.Page) = Me.LName
Me.thetextbox = Me.LName & " - " & strLastItems(Me.Page)

But I tested it and work only when the Text Box option "Not Can Grew" on
Detail.
It give wrong result when The Text Box on Detail option format choose YES to
" Can Grew"

Do you have any ide to fix it such as make compare with every page that view
or something like that, to let give correct result when text box can grew on
Detail?
Because now with this code only few page can give correct result and then it
give
wrong result.
Here is the sample that you can check the report page and see it give only
few page correct then will be give wrong result.

http://home.swipnet.se/georgedesign/dict/first-word.mdb

God Bless

If you are trying to create something like a Phone book with the first
record Name on the page and the last record Name on the page shown in
the page header, you might find this a bit easier.

Let's assume it's a directory of Customers.

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 customer name control in the header.
Whatever the first record on the page is will be shown in the Page
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 datatype)
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 20 pages, make at least 20+ records.
(If you expect 500 pages, 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. You can make this control not visible if you do not want to
show it.

Then add a control in 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) &
[CompanyName] & Chr(34) & "Where [ID] = " & [Page]

On the first pass, the table is updated after each page with the final
company name on that page.
Then the report is displayed and the DLookUp in the Page Header
control reads the corresponding page customer's name from the table.

Works fine for me.
 
Jemsson said:
I found this arry code that man can take the last word from Pagefoot to
PageHead.

Dim strLastItems(500) As String
strLastItems(Me.Page) = Me.LName
Me.thetextbox = Me.LName & " - " & strLastItems(Me.Page)

But I tested it and work only when the Text Box option "Not Can Grew" on
Detail.


That code is incomplete so I can't be sure what you're
doing. However, I suspect that the line:
strLastItems(Me.Page) = Me.LName
is somewhere other than the page footer section's Format
event.

The other line must be in either the page header's Format or
Print event and there must be a text box somewhere on the
report that refers to the Pages property.
 
Hello

First of all, I would like to thank you for helping.

I tested the code you wrote and it give seem result of arry.
Here is the file you can open and look at Report
name: I need this report - The Arb Field Will grow

http://w5.nuinternet.com/s650100026/first-word.zip

And then check ex. page number 23 there you will see it take very wrong
result.
So this file is as sample and you can see few is wrong and few is correct.

page 1 = wrong
page 2 = Correct
page 3 = Correct
page 4 = Wrong
page 5 = Correct
page 6 = Correct
page 7 = Correct
page 8 = Wrong
page 12 = Wrong "It take first post fron next page"
page 23 = Wrong " It take 2 post before last post"


Thanks alot
 
Hello

First of all, I would like to thank you for helping.

I tested the code you wrote and it give seem result of arry.
Here is the file you can open and look at Report
name: I need this report - The Arb Field Will grow

http://w5.nuinternet.com/s650100026/first-word.zip

And then check ex. page number 23 there you will see it take very wrong
result.
So this file is as sample and you can see few is wrong and few is correct.

page 1 = wrong
page 2 = Correct
page 3 = Correct
page 4 = Wrong
page 5 = Correct
page 6 = Correct
page 7 = Correct
page 8 = Wrong
page 12 = Wrong "It take first post fron next page"
page 23 = Wrong " It take 2 post before last post"


Thanks alot
 
Back
Top