Page 3 of 5 FirstFirst 12345 LastLast
Results 31 to 45 of 71
  1. #31
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Sorry for late reply, had a very busy weekend
    I guess you put that:
    NoOfPages = Report.Page
    the same way as UpdateToc(..... etc.
    This is different. You need to:
    - select page footer in design mode


    - on Event page of properties windows select OnPrint event
    - click eclipse on the right to it
    - select Event Procedure if asked
    Click image for larger version. 

Name:	tocfoot1.jpg 
Views:	11 
Size:	70.4 KB 
ID:	23782

    - put this code in procedure opened in VBA editor so it looks similar to this:

    Code:
    Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
        NoOfPages = Report.Page
    End Sub
    Repeat it for every report.

  2. #32
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    Ok changed the code, however still get that Variable error and when I debug it goes to the module code. Thanks for your help.

    Click image for larger version. 

Name:	Capture.JPG 
Views:	11 
Size:	33.7 KB 
ID:	23783

  3. #33
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    Actually never mind I figured it out. Some error in the code was calling the wrong table.
    Now it works but I am still having issues with the sorting on the Table of Contents. Grouping doesn't seem to have an option other then alphabetical. Always puts Awaiting Decisions first.
    As well the counting doesn't work correctly. I am not sure this is going to work without doing sub reports. As when you print out the 3 separate reports I think it will never count correctly.


    Thanks
    Peter

  4. #34
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Quote Originally Posted by pharrison74 View Post
    Actually never mind I figured it out. Some error in the code was calling the wrong table.
    Now it works but I am still having issues with the sorting on the Table of Contents. Grouping doesn't seem to have an option other then alphabetical. Always puts Awaiting Decisions first.
    True, that's why you may need to add something to title (i.e. number in front) to force sorting as you want.
    Quote Originally Posted by pharrison74 View Post
    As well the counting doesn't work correctly. I am not sure this is going to work without doing sub reports. As when you print out the 3 separate reports I think it will never count correctly.
    Counting this way will work, I just don't have much time now to test it properly. I'll try to find a moment later on and we'll sort it out.

  5. #35
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    Ok, I really do appreciate your help on this thank you.

  6. #36
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Ok, had a moment to work on it finally. Have a look at attached db. Counting works and sorting works as you wanted. Try to understand what and how works and if you have any question - ask

    Testing_Litigation_DB1.zip

  7. #37
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    Click image for larger version. 

Name:	Capture.JPG 
Views:	10 
Size:	30.1 KB 
ID:	23811I went over the code. I did notice you added a " 1. inside the Toc settting so I included that and it is now sorting correctly. However for the life of me I don't see
    why it doesn't count the pages correctly.

    I did notice your code has

    toctable![PageNumber] = sTitle however if I match that I get a debug error. I have to use [Page number] instead.

    Other then that I am not sure what I am missing

  8. #38
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Quote Originally Posted by pharrison74 View Post
    I did notice your code has
    toctable![PageNumber] = sTitle however if I match that I get a debug error. I have to use [Page number] instead.
    Uhmm... not true.
    There's nothing like that in my code.
    Code:
    Function UpdateToc(tocentry As String, Rpt As Report, sTitle As String)
       toctable.Seek "=", tocentry
       If toctable.NoMatch Then
          toctable.AddNew
          toctable!Case_Name = tocentry
          toctable![PageNumber] = NoOfPages + 1
          toctable!Title = sTitle
          toctable.Update
       End If
    End Function
    I don't know where did you get it from. Maybe try download it and unzip again in different folder?
    Then just open unzipped db, print preview 3 reports (rpt1... etc), then ToC report and see if it's ok (because it is on my side).

  9. #39
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    Yeah for what ever reason it works without the space in the test DB. However it is the only difference I see. Just not sure what it doesn't count that 3rd report correctly as pg 3. Here is the code that you sent me.
    Mine has to have a space inbetween Page and Number.

    Thanks
    Pete

    Click image for larger version. 

Name:	Capture.JPG 
Views:	9 
Size:	110.2 KB 
ID:	23813

  10. #40
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Oh, ok, I know what you mean now.
    [Page number] is a field name in ToC table. I probably changed it on the way from [Page Number] to [PageNumber] (or opposite). Just make them the same in table and in code.
    As for page numbering - there's more changes in code than those in module1. Check also code for On Page events in reports.
    I know it may be confusing now, too many versions of db flying around. If you could upload your db again I'd update the code for you in it and upload it back. Just make sure there are at least few dummy records in "Legal Issues" table to produce all 3 reports, because I'm little tired of filling that table again and again

    Edit:
    This is how it works for me:

    Click image for larger version. 

Name:	tocx1.jpg 
Views:	9 
Size:	30.5 KB 
ID:	23814

    rpt 1 has 1 page, rpt2 - 2 pages, rpt3 - 1 page

  11. #41
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    Testing_Litigation_DB1.zip


    Ok here is the newest db from my end. put some junk data in and unfortunately deleted my own data as I thought I was in the test one...LOl...Oh well will just reenter it.


    Again thank you for all your help.

  12. #42
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Hmm, it's the same db I sent you, not yours, and this one works properly
    I want your db with your reports design and your data (fake of course) and your actual code.

  13. #43
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    Lol I see what I did. sorry. Here you go..Testing_Litigation_DB1.zip

  14. #44
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    Ok, this should work:

    Testing_Litigation_DB1.zip

    I added numbers to report names to make it more clear. You need to print them in order as number 1 runs InitToc() function that prepares ToC table.

  15. #45
    pharrison74 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    114
    I get a weird popup when I do print preview. I can click ok and then it is fine. Does it for all three is this normal? As well it still isn't counting correctly it shows all items on page 1 for Decisions Released but there is a page two to the report.

    Click image for larger version. 

Name:	Capture.JPG 
Views:	7 
Size:	13.8 KB 
ID:	23823Click image for larger version. 

Name:	Capture2.JPG 
Views:	6 
Size:	19.6 KB 
ID:	23825

Page 3 of 5 FirstFirst 12345 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 03-04-2014, 04:58 PM
  2. Table of Contents
    By Alex Motilal in forum Reports
    Replies: 1
    Last Post: 09-17-2012, 10:48 AM
  3. Replies: 5
    Last Post: 04-18-2012, 12:04 PM
  4. Replies: 10
    Last Post: 01-06-2012, 07:46 AM
  5. Print Separate Reports with collate
    By HendriX99 in forum Reports
    Replies: 3
    Last Post: 02-04-2011, 07:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums