Results 1 to 9 of 9
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    my own page numbering?

    Hi,

    I am working in Access 97.

    I am creating a report based on an Employee table. I've created a query for the table since only reports are to be generated only for active employees (non-active ones are still in the Employee table). Each employee is to begin a new page. I have that down - no problem.

    The problem is with Access's numbering of pages. When creating the Report with the Wizard, Access creates a "page of pages" footer.

    This may be problematic for the employees. Employee A sees his report as "1 of 5"; Employee B sees her report as, say, "2 of 5". Etc. So Employee A may ask "where's the other 4 pages of the 5?" B may ask why her report starts at page 2. So I'm trying to avoid this.

    Even if I leave out the [Pages] part, a particular employee's report, except the first, won't start at page 1.

    So I'm searching for another approach. Ideally, each employee would see "1 of n" and continuing for as many pages as needed for that employee. The next employee would start over at "1 of m". Next step down in preference would just provide for page numbering as "1", "2", etc with no "of n".

    I've tried some code for the latter. On Report Open, I set a variable SaveEmployee = "noEmployee". Then On Page Footer, I examine if EmployeeName (the field from the underling query) = SaveEmployee.
    - if so, I increment the page number
    - if not, I set the page number = 1 and update SaveEmployee
    In either case, I set a control in the footer to my page number as part of the On Footer macro.

    The above seems to work as far as the numbering goes - it starts at 1 for each employee. However, since the report isn't fleshed out yet (just has a group header for the employee name and his/her start date), I can't tell what will happen if the report goes to page 2. So I just put in some labels and repeated the employee name as a text box in the detail section. What I'm getting is a blank page 1 as far as the report content goes. My labels and text box come out on page 2. When I start a new employee, same thing.

    I also thought about accessing the records of the table directly from within a loop and opening the report with a Where string constructed for each employee. I haven't tried this yet. This would seem like it should solve all the problems and even give me the "1 of n" and start over for each employee. But I do have concerns about the speed of this as opposed to handling this through the query based on the table.

    Thoughts on any of the above or other approaches to getting the page #s "right"?

    Thanks.

    Fred

  2. #2
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: my own page numbering?

    <hr>Next step down in preference would just provide for page numbering as "1", "2", etc with no "of n".
    <hr>
    I believe setting Group Properties as in the attached example and a text box in the Page Footer containing ="Page " & [Page] will achieve your second preference. I'm watching for a solution to your first preference.
    Attached Images Attached Images

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: my own page numbering?

    There are samples in the Solutions database for each version of Access that demonstrate custom "Page 1 of N" numbering for grouped reports. Of course, they depend of set the report to insert a new page each group. The Solutions database for 2000 is on the CD, but I believe you had to download it for 97.
    Charlotte

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    NYC,USA,Earth
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: my own page numbering?

    The samples are on my copy of the Office97 Pro CD.

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: my own page numbering?

    There's also a sample reports database you can download from Microsoft that wasn't on the CD.
    Charlotte

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: my own page numbering?

    Charlotte,

    Thks for the tip. I'm familiar with the Solutions sample DB and have it. In fact,I had looked at it for other things but didn't notice this. I'll take another look. Thks.

    Fred

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: my own page numbering?

    Brian,

    Thks for the response. In fact, I had my group settings for the employee group pretty much as you suggested. Just didn't have a footer. But this did not work (yet). Recall that I made up some sample data to see what happens when I have info that forces a second page. Problem was that the first page ends up with just the employee name and hire date and a page footer at the bottom. Rest of the page is blank. The data comes out on page 2. Definitely an undesired result. Maybe with real data it will work but not sure why it should.

    Thks for the suggestion. I'm going to try Charlotte's suggestion and check out the custom 1 of N in the Solutions DB.

    Fred

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: my own page numbering?

    I could be misremembering. It's possible that the example is in the sample reports database you can download from MS. The filenames are <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q231/8/51.ASP>RptSmp00.exe</A> and RptSmp97.exe. I don't know where they have the 97 version stashed anymore. The last time I found it, it was in a virtual directory somewhere on the MS site.
    Charlotte

  9. #9
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: my own page numbering?

    Charlotte,

    I've now looked at both the Solutions and Northwind DBs as well as the rptsmp00 file on the MSKB site. The first 2 DBs didn't have anything at all on the topic. The MSKB file had an example of prompting for the starting page# of a rpt when other than 1. This is not what I'm after.

    Perhaps I will need to go thru the table of employees in code and call the report with a Where string for each employee. I saw an example of a similar but not-quite approach in the Solutions DB where a rpt could be called for all items in a category (all pages numbered from 1 to the end with "of n" on each page) or just for a specific item which is selected from a list box.

    My appl is similar. I have a bunch of employees. In one instance, I have to print a report for all employees. In another instance (using the Solutions as a guide), I only need to print a specific employee. In the former case, I prefer each employee to begin with a pg1 and "of n" to be just for that employee. I can get the pg1 part with code but can't get the "of n" just for him/her.

    My 2 fallbacks are:
    - forget the "of n" but this is still a problem per previous email (get no details on page 1)
    - use code to go thru the table of employees and open the report with a Where constructed for each employee.

    Any other thoughts? Thks.

    Fred

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •