A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Saving page number from report



 
 
Thread Tools Display Modes
  #1  
Old March 26th, 2010, 02:07 AM posted to microsoft.public.access.reports
Phillip
external usenet poster
 
Posts: 63
Default Saving page number from report

Hi,
I have about a 200 page report that gets its data using every record in a
table. I would like to have a field in each record for a page number and
have the field filled as the report prints. I can then use that
information to print various indexes and table of contents. Is there a way
to assign the page number to each record as the report pirnts? If no is
there a better way?
Thanks,
  #2  
Old March 26th, 2010, 03:57 AM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default Saving page number from report

You can create a table for holding the page numbers. Then put code in the
report's sections to write the values you need to that table.

In the Report's Open event procedure, delete any existing entries in the
table (from last time the report was run.), and OpenRecordset to append the
values.

In the Print event of the Detail section, AddNew to the recordset, to record
the primary key value and page number or whatever you need.

In the report's Close event, close your recordset.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phillip" wrote in message
...
Hi,
I have about a 200 page report that gets its data using every record in a
table. I would like to have a field in each record for a page number and
have the field filled as the report prints. I can then use that
information to print various indexes and table of contents. Is there a
way
to assign the page number to each record as the report pirnts? If no is
there a better way?
Thanks,


  #3  
Old March 26th, 2010, 04:49 AM posted to microsoft.public.access.reports
Phillip
external usenet poster
 
Posts: 63
Default Saving page number from report

Thanks for your response,
Is there no way to place the page number in the table that report was
printed from?
Thanks,

"Allen Browne" wrote:

You can create a table for holding the page numbers. Then put code in the
report's sections to write the values you need to that table.

In the Report's Open event procedure, delete any existing entries in the
table (from last time the report was run.), and OpenRecordset to append the
values.

In the Print event of the Detail section, AddNew to the recordset, to record
the primary key value and page number or whatever you need.

In the report's Close event, close your recordset.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phillip" wrote in message
...
Hi,
I have about a 200 page report that gets its data using every record in a
table. I would like to have a field in each record for a page number and
have the field filled as the report prints. I can then use that
information to print various indexes and table of contents. Is there a
way
to assign the page number to each record as the report pirnts? If no is
there a better way?
Thanks,


.

  #4  
Old March 26th, 2010, 06:52 AM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default Saving page number from report

You can't get the page numbers into the table until the report pages have
been run, so the best you can to is to make another report as the table of
contents.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phillip" wrote in message
news
Thanks for your response,
Is there no way to place the page number in the table that report was
printed from?
Thanks,

"Allen Browne" wrote:

You can create a table for holding the page numbers. Then put code in the
report's sections to write the values you need to that table.

In the Report's Open event procedure, delete any existing entries in the
table (from last time the report was run.), and OpenRecordset to append
the
values.

In the Print event of the Detail section, AddNew to the recordset, to
record
the primary key value and page number or whatever you need.

In the report's Close event, close your recordset.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phillip" wrote in message
...
Hi,
I have about a 200 page report that gets its data using every record in
a
table. I would like to have a field in each record for a page number
and
have the field filled as the report prints. I can then use that
information to print various indexes and table of contents. Is there a
way
to assign the page number to each record as the report pirnts? If no
is
there a better way?
Thanks,


.

  #5  
Old March 26th, 2010, 02:33 PM posted to microsoft.public.access.reports
Phillip
external usenet poster
 
Posts: 63
Default Saving page number from report

Hi again,
Let me ask another question: I have a form with a command button that calls
the report. The form also has sort buttons that the user can click on to
sort the form on various feilds before they print the report. Is it possible
to have code in the form that would place the page numbers in the main table
based on the sort button selected? The pages in the report are printed in
the same order as the records shown on the form.
It would be very easy for the indexing I want to do if I could get the page
numbers in the main table.
Thanks,

"Allen Browne" wrote:

You can't get the page numbers into the table until the report pages have
been run, so the best you can to is to make another report as the table of
contents.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phillip" wrote in message
news
Thanks for your response,
Is there no way to place the page number in the table that report was
printed from?
Thanks,

"Allen Browne" wrote:

You can create a table for holding the page numbers. Then put code in the
report's sections to write the values you need to that table.

In the Report's Open event procedure, delete any existing entries in the
table (from last time the report was run.), and OpenRecordset to append
the
values.

In the Print event of the Detail section, AddNew to the recordset, to
record
the primary key value and page number or whatever you need.

In the report's Close event, close your recordset.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phillip" wrote in message
...
Hi,
I have about a 200 page report that gets its data using every record in
a
table. I would like to have a field in each record for a page number
and
have the field filled as the report prints. I can then use that
information to print various indexes and table of contents. Is there a
way
to assign the page number to each record as the report pirnts? If no
is
there a better way?
Thanks,

.

.

  #6  
Old March 27th, 2010, 03:13 AM posted to microsoft.public.access.reports
Allen Browne
external usenet poster
 
Posts: 11,706
Default Saving page number from report

It may be possible to do that, but that are many things that may may it
impractical, e.g.:

a) Sections CanGrow or CanShrink, so you don't know how many records will
actually fit on each page.

b) You'd need to take into account the number of Group Header and Group
Footer sections on each page.

c) Many properties on the report may mess this up, e.g. Keep Together
property of the sections, and the Keep With Next (or keep all together)
setting for the group headings, or Page Break Before etc

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phillip" wrote in message
...
Hi again,
Let me ask another question: I have a form with a command button that
calls
the report. The form also has sort buttons that the user can click on to
sort the form on various feilds before they print the report. Is it
possible
to have code in the form that would place the page numbers in the main
table
based on the sort button selected? The pages in the report are printed in
the same order as the records shown on the form.
It would be very easy for the indexing I want to do if I could get the
page
numbers in the main table.
Thanks,

"Allen Browne" wrote:

You can't get the page numbers into the table until the report pages have
been run, so the best you can to is to make another report as the table
of
contents.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phillip" wrote in message
news
Thanks for your response,
Is there no way to place the page number in the table that report was
printed from?
Thanks,

"Allen Browne" wrote:

You can create a table for holding the page numbers. Then put code in
the
report's sections to write the values you need to that table.

In the Report's Open event procedure, delete any existing entries in
the
table (from last time the report was run.), and OpenRecordset to
append
the
values.

In the Print event of the Detail section, AddNew to the recordset, to
record
the primary key value and page number or whatever you need.

In the report's Close event, close your recordset.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phillip" wrote in message
...
Hi,
I have about a 200 page report that gets its data using every record
in
a
table. I would like to have a field in each record for a page
number
and
have the field filled as the report prints. I can then use that
information to print various indexes and table of contents. Is
there a
way
to assign the page number to each record as the report pirnts? If
no
is
there a better way?
Thanks,

.

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.