Results 1 to 6 of 6
  1. #1
    bsmith1073 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    3

    Continue row sequence numbering through multiple subreports

    Hello,

    Long time reader, first time poster!



    I’m building a report in Access and it is comprised of 2 subreports (each report pulls data from separate queries). I want to build an “Item Count” associated with each row of data. I added a text box in each subreport and set the control source to =1 and running sum "over all". This provides an item count for each subreport but I would like the 2nd subreport to continue from the first subreport last count. Everything I’ve tried so far brings up a #Name? or #Error? message in the 2nd subreport. I even tried to add a hidden counter in the first subreport footer and link to that but couldn’t figure out how to do so.

    Where am I going wrong? Thanks in advance for any pointers/solutions to my problem.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    See if this link helps with the syntax. Reports are just like Forms (sort of ): http://access.mvps.org/access/forms/frm0031.htm

  3. #3
    bsmith1073 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    3
    Thanks for the link. I have now added some vba into the main report header that reads:

    Private Sub PageHeaderSection_Paint()
    Me.[PAR_Posting_PartialPay]!partialcounterhidden.Value = [PAR_Posting_PP]!itemNo + 1
    End Sub

    Subreport 1 (extension _PP) contains the starting sequence numbers within the ItemNo column. Subreport 2 (extension _PartialPay) contains a hidden field in the header named partialcounterhidden that takes the total ItemNo count plus 1. The idea was that the Item No field in _PartialPay would read the hidden field in the header as its' starting point. To this degree, it worked...only now each row in _PartialPay is adding the value in partialcounterhidden and not just using it as a starting point.Click image for larger version. 

Name:	AccessSnippet.JPG 
Views:	12 
Size:	23.1 KB 
ID:	23512

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It looks to me as though you put the value into the wrong control.

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did that resolve your issue?

  6. #6
    bsmith1073 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2016
    Posts
    3
    You were partly correct. Instead of using the itemno field, I needed the counter field. I also needed to add an incrementor/adderx function. A whole lot more work than I initially expected! But we can mark this as resolved.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple Subreports
    By aytee111 in forum Reports
    Replies: 2
    Last Post: 10-15-2015, 03:42 PM
  2. Replies: 1
    Last Post: 10-16-2013, 03:44 PM
  3. Replies: 4
    Last Post: 01-25-2013, 01:57 PM
  4. Replies: 3
    Last Post: 01-02-2011, 07:17 PM
  5. Multiple Subreports with page break
    By rayc in forum Reports
    Replies: 7
    Last Post: 09-02-2006, 06:59 PM

Tags for this Thread

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