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, 
0
Utf
3/26/2010 2:07:02 AM
access.reports 4434 articles. 0 followers. Follow

5 Replies
796 Views

Similar Articles

[PageSpeed] 0

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" <Phillip@discussions.microsoft.com> wrote in message 
news:CE1A4933-4352-4C60-99DF-2287B1FA5FED@microsoft.com...
> 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, 

0
Allen
3/26/2010 3:57:10 AM
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" <Phillip@discussions.microsoft.com> wrote in message 
> news:CE1A4933-4352-4C60-99DF-2287B1FA5FED@microsoft.com...
> > 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, 
> 
> .
> 
0
Utf
3/26/2010 4:49:01 AM
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" <Phillip@discussions.microsoft.com> wrote in message 
news:D6B32B7B-7FF5-46E3-8F46-C55605817DB1@microsoft.com...
> 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" <Phillip@discussions.microsoft.com> wrote in message
>> news:CE1A4933-4352-4C60-99DF-2287B1FA5FED@microsoft.com...
>> > 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,
>>
>> .
>> 
0
Allen
3/26/2010 6:52:42 AM
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" <Phillip@discussions.microsoft.com> wrote in message 
> news:D6B32B7B-7FF5-46E3-8F46-C55605817DB1@microsoft.com...
> > 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" <Phillip@discussions.microsoft.com> wrote in message
> >> news:CE1A4933-4352-4C60-99DF-2287B1FA5FED@microsoft.com...
> >> > 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,
> >>
> >> .
> >> 
> .
> 
0
Utf
3/26/2010 2:33:02 PM
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" <Phillip@discussions.microsoft.com> wrote in message 
news:4BCA3B8C-68C6-4B97-B4F5-7D264B9BF0EA@microsoft.com...
> 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" <Phillip@discussions.microsoft.com> wrote in message
>> news:D6B32B7B-7FF5-46E3-8F46-C55605817DB1@microsoft.com...
>> > 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" <Phillip@discussions.microsoft.com> wrote in message
>> >> news:CE1A4933-4352-4C60-99DF-2287B1FA5FED@microsoft.com...
>> >> > 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,
>> >>
>> >> .
>> >>
>> .
>> 
0
Allen
3/27/2010 3:13:29 AM
Reply:

Similar Artilces:

Reporting IRA distributions
I have an IRA account with corresponding cash account. I am trying to get the distribution from the IRA to show up as "Retirement Income" in the Tax-Related Transactions report. How to do it? The distributions are handled as a transfer from the IRA Investment cash acct to a checking account. Thanks for any help. Money 99, BTW. Do I need to upgrade to a later version? ...

Errors saving to network drive
When my users open an Excel spreadsheet located on a network drive, make their changes, and then try to save the spreadsheet, they get an error message saying "Your changes could not be saved to Whateverfile.xls, but were saved to XXXXXXXX ( 8 digit hex number ). Close the existing document, then open the temporary document and save it under a new name" The users have been explicitly granted full rights, including Delete and Modify, to the shared folder in which the spreadsheet resides. I have disabled their Symantec Antivirus realtime protection for the time being. This pr...

PAGE SIZE DIFFICULTY
WHEN I CHANGE MY PAGE SIZE AND PAPER SIZE MY PUBLICATION REMAINS THE SAME. COULD SOMEONE TELL ME HOW TO SHRINK MY DOCUMENT TO MATCH MY PAPER SIZE >-----Original Message----- >WHEN I CHANGE MY PAGE SIZE AND PAPER SIZE MY PUBLICATION REMAINS THE SAME. >COULD SOMEONE TELL ME HOW TO SHRINK MY DOCUMENT TO MATCH MY PAPER SIZE >. > Choose Page setup from the File drop down menu and set the page size to suit your needs. Note that elements on the page do not change. You will have to rearrange to suit. MISS2728 wrote: > WHEN I CHANGE MY PAGE SIZE AND PAPER SIZE MY PUBLICATION RE...

publisher. why does webpage preview show only half page
When I'm viewing my webpage design in webpage preview I am getting a large empty space on the right hand side and bottom of the page On Fri, 17 Feb 2006 17:50:02 +0000, yousane wrote (in article <65E39911-B9CA-4785-BD48-358D03F3695A@microsoft.com>): > When I'm viewing my webpage design in webpage preview I am getting a large > empty space on the right hand side and bottom of the page And your problem is...? That's how it's supposed to be. Web pages designed in Publisher do *NOT* fill the entire screen. I suggest you learn to use the right tool for the job (I&...

Heading at top of page
Working in Word 2003, I put two spaces between a paragraph and the next 'heading 2'. This works fine until the 'heading 2' spills on to the next page. There is then two spaces gap at the top of the page. Is there a way to tell word to keep the heading at the top of the page if it spills over? Don't want to put in a hard page break. Thanks Jon. -- j4k How are you creating the spacing? If you are pressing Enter twice, then don't. Use Spacing Before instead (Paragraph dialog box, Indents and Spacing tab). -- Stefan Blom Microsoft Wo...

Saving toolbar changes
After spending a lot of time to customize a toolbar in Excel 2003, it disappears when opening up another file, or starting the app again. I repeatedly change it, save it as XLB, XLT, save multiple copies in every possible location...but the damn thing always defaults to its own toolbar settings. This makes toolbars almost useless. How can one insist that PPT use YOUR toolbar setting, rather than its own default Thanks. Hi Jeff, If I have a lot of tool bar changes to make, I close all the workbook that are not hidden then unhide my personal.xls from the Window menu. I don't know why...

Change cannot be saved due to sharing violation
Hello I've this message while saving the excel file even if no change ha been done to the file. There is no share on this file (exclusive use) File resides on a network drive It's very disturbing Thanks for your help Vobiscu -- Vobiscu ----------------------------------------------------------------------- Vobiscum's Profile: http://www.msusenet.com/member.php?userid=245 View this thread: http://www.msusenet.com/t-187102186 http://support.microsoft.com/default.aspx?scid=kb;en-us;328170 Thanks for your answer, I will try tomorrow noo Vobiscu -- Vobiscu ----------------...

Format for credit card numbers
I've tried a custom format for entering credit card numbers (four groups of four digits, separated by dashes: xxxx-xxxx-xxxx-xxxx. I have tried to use ####-####-####-#### and 0000-0000-0000-0000 but each of these causes the last digit to change to zero. So if I enter 5415779800902512 I get 5415-7798-0090-2510. Anybody already solved this problem? -- Schmacker ------------------------------------------------------------------------ Schmacker's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28041 View this thread: http://www.excelforum.com/showthread.php?th...

limit the number of outgoing messages
Hi, who can I limit the number of concurrent outgoing messages? for example: if I have a queue of 1000 messages, how can I force exchange to send only 50 messages at a time? ...

how do you get a landscape page?
Please help, desperate! If you are using 2010, Page Design tab, Size, More pre-set page sizes. Letter landscape is the first choice. In all other Publisher versions landscape will be on the page setup screen found in the File menu. -- Mary Sauer http://msauer.mvps.org/ "becky.x" <becky.x@discussions.microsoft.com> wrote in message news:25D3EDBC-93EF-4582-94B2-83C9CE121E17@microsoft.com... > Please help, desperate! ...

Publisher can not save file
I recently started having troubles with my Publisher 2003. Whenever I go to save my files now, using save as or just the save button, it gives me a dialog box that says "Can not save file." It does that twice, then it disappears. I also noticed that when it does this, it leaves the .tmp files in the directory where I tried to save. I can change the name of the files, and sometimes it will save it. Most of the time not though. I have NAV, and I noticed that it was said there was an issue with Publisher and NAV. Is this the same with the 2005 version, and is this anything anyone...

Report Can Grow not aligned horizontally
I have a report where I have 1 row of text, memo, number, and date fields. The memo field can contain up to 4-5 lines of wrapped text. I have set all teh rows to "can grow". However, on my report, the conditional formatting doesn't grow. For instance, the fill (which I have set to a gray color) in the memo field is about 3 lines deep when there is a lot of text in the memo field, but the text and number fields associated with that record are actually only 1 line. This essentially looks like a mess, small gray filled boxes for the text fields and a large gray ...

Custom reports #3
Hi, I want to pull a report on how many customers I am getting every hour of the day. Does anyone out there know how to do that? I can try writing a query if someone can tell me which table I can find this information in (timestamp, transaction etc). Any help is appreciated. Regards JD This info is given at the end of the Z report. If you want to use it in a query open the Z report recipt file using the Notepad and see the fields that are used... Report.Hour.HourSales etc... Hope this helps... Carlos "JD" wrote: > Hi, > > I want to pull a report on how many cust...

Saving #5
Is there a way of speeding up saves in excel or a way to condense the size of a workbook. Jason, This link can help with the size issue... http://www.contextures.on.ca/xlfaqApp.html#Unused Item 2d is the one you want. Regards, Jim Cone San Francisco, USA "Jason Zischke" <JasonZischke@discussions.microsoft.com> wrote in message news:18CCEA1F-2479-4ED9-A5F6-21B781D0F403@microsoft.com... > Is there a way of speeding up saves in excel or a way to condense the size of > a workbook. ...

Numbering in Book Files
I am creating a tech manual where each chapter is its own file. I have created an outline numbered list and saved the list in a template that I then use to create the new chapters. However, I am finding that when I go into a new chapter that the outline numbering does not pick up on the chapter (Heading 1) number. For example: Chapter 1: Heading 1 style 1.1: Heading 2 style 1.1.1: Heading 3 style, etc. But when I start my next chapter, when I update the chapter number to start at 2, I get this: Chapter 2: Heading 1 style 1.1: Heading 2 style 1.1.1: Heading 3 style, etc. ...

Removing text from cells leaving numbers (help with function)
I need a function that will remove all text from a cell and just leav numbers. Formatting cells to number does not work. For example if I have: (Sired] Tennessee 37013 (herein I just want 37013 left. Anybody know a function to resolve this -- Message posted from http://www.ExcelForum.com The following will strip the text from the active cell and place the number in the adjcent cell one column to the left. If there are subsequent numbers in the original string you will get erroneous results. Put the cursor on the cell to be processed and run the macro. ********************************...

how to run onhand value report
I get the message enter parameter when entering the zoom feature On Sat, 6 Mar 2010 17:36:01 -0800, junebugg <junebugg@discussions.microsoft.com> wrote: >I get the message enter parameter when entering the zoom feature You'll have to give us some more context than that, junebugg. What's the "onhand value report"? What's the "zoom feature"? You can see your database; we cannot! -- John W. Vinson [MVP] ...

Formula to count the number of different values in a range
I'm looking for a formula that will give me the number of different values in a range. Example: Column A may have five cells that are "4", five cells that are "7", five cells that are "9". Of the fifteen cells that contain data, there are only 3 different values. I'd like to use a formula that will count the number of different values in column A, in this case the result is "3". Thanks, Paul Try... =SUMPRODUCT((A1:A15<>"")/COUNTIF(A1:A15,A1:A15&"")) OR =SUM(IF(A1:A15<>"",1/COUNTIF(A1:A...

Saving document downloaded from email
I downloaded a word 2007 document from a windows mail email yesterday by double clicking on it and opening in word 2007. I then worked on the document and clicked "save". Today I cannot find the document on the computer, it seems that it has not saved. Can anyone explain what has gone wrong? Thanks Catherine If you use Word and Outlook 2007 this should no longer happen as the combination does not allow you to save to a temporary location With other e-mail applications, it is anyone's guess what might occur. You should never open Word attachments directly from e-m...

How do I save a header?
I need to permanently save a header and it will never save once I open up a new file. Any suggestions? Try a look in the Excel Help under 'Create a Template'. Saving the header in the template should mean each time you open that template the header will be there. Regards, Tom "Global10" wrote: > I need to permanently save a header and it will never save once I open up a > new file. Any suggestions? Open a new workbook. Customize as you wish including your print settings.........group the sheets before setup so's all sheets get same Heade...

Saving Pictures
I read all the info on the forum about saving pictures but when I open Power Poing, I don't get the usual buttons at the top. It opens to a page layout with Home, Insert, Page layout and so on. When I try to open the email just to see what files are in it, it shows the slide show. -- Gary So, first save it to your hard drive. Then open PowerPoint Then Open the file within PPT "skydiver9696" <skydiver9696@discussions.microsoft.com> a �crit dans le message de news: 396594B0-40D7-4D7F-A560-6F93662A8D57@microsoft.com... >I read all the info on the forum abou...

Report: Cell #1, Cell #2, Cell #3, Cell #4
I am stuck again and would love som help :( I would like to repeat all words found inside ~25 cells, separated only by ", ", ignoring empty cells. Data: A1: [Apple ] A2: [Orange] A3: [Banana] A4: [Tomato] A5: [Syrup ] A6: [ ] A7: [ ] A8: [ ] The result should be something like: [Apple, Orange, Banana, Tomato, Syrup] -- JemyM ------------------------------------------------------------------------ JemyM's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=26945 View this thread: http://www.excelforum.com/showthread.php?thre...

How to show query parameters on an Excel page header or worksheet?
Is it possible to display query parameters on a page header or on a worksheet? I have a worksheet that uses a query to retrive data from an ODBC database. The Query prompts for the Start Date and End Date. I would like to be able to print the worksheet and display the Start Date and End Date the user typed in. Thank you for your assistance. ...

Departments on Z Report
Hello, I have noticed that as I set up new departments and categories into the database, the new departments are always printed last...or below all of the other departments. Is there a way to change this, and possibly have them organized alphebetically or in an order I would like? Thank You, Vicne Perhaps if you modified the department table usinfg Microsoft Access 2003 .... not that I would advise that :-) Vince... is this you... my buddy? Since you don't use an email address... I'm never sure if it you... and then I worry I'm getting too personal with someone I don'...

How do I assign a name to a PDF report via VBA
Thanks to the internet site: http://msdn.microsoft.com/en-us/library/ee336132.aspx I have the following subprocedure: Private Sub Print_to_PDF_Click() On Error Resume Next Dim reportName As String reportName = "HCBS CMgr Smmry Report" DoCmd.OpenReport reportName, _ View:=acPreview, WindowMode:=acHidden Set Reports(reportName).Printer = _ Application.Printers("CutePDF Printer") DoCmd.OpenReport reportName, _ View:=acViewNormal End Sub This appears to be a good start; however, it stops and waits for me to enter the n...