Results 1 to 5 of 5
  1. #1
    novicesupremo is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2011
    Posts
    3

    Subreport within a report with links between two fields

    I am trying to create a report that combines two reports into one. The main report essentially keeps track of companies that are licensed to use a particular product while the sub-report tracks instances of the uses observed by each licensee. What I want the combined report to do is list all the different companies that are licensed to use a particular product with a subreport for each company and license that has the individual uses of the product.

    Linking the two reports together within the same report should be straightforward because I am using both a company name field and a product id field to connect the two tables that the information is coming from.



    However, I am not having any kind of luck when I run the report. The sub-report doesn't seem to be matching up individual uses with the license records for each company.

    Does anybody have an idea why it isn't working?

    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Would need to know more about table structure and see the RecordSource property for each form. Are Master/Child properties of the subform container properly set? Do you want to make the project available for analysis - at least the objects of issue?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    novicesupremo is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2011
    Posts
    3
    Without going in to too much detail (I cannot actually post the database because my boss wants it kept entirely internal), the report is drawing from two tables. The first table (the licensees rights table) contains two important fields for the purposes of the report: an ID field (which is a non-unique mark that indicates the type of product that the licensee is using) and the entity name (which is the name of the actual licensee). The report contains a grouping function that lists each licensee and all the product IDs they are using. No problem there.

    However, where the problem arises is at the point that I want to run a sub-report within the above report that draws from a separate table: the usages table. What the usages table does is classify particular uses of each licensee from the licensees rights table. Because the usages table has two of the same fields that the licensees rights table has (the ID field and the entity name field) I figured that I could have the sub-report list all of the individual uses of each licensee for each product ID. When I created the sub-report, I made sure that the "Link Master Fields" and Link Child Fields" options in the property sheet allowed the ID and entity name fields to be linked. I thought this should work but when I run the report, the main report seems to work fine (meaning that each licensee and the products they are registered for displays just how I want it to). However, the usages sub-report returns all uses from all different licensees, not just the one individual licensee which is what I want.

    Sorry I can't post the actual database but I hope this additional information is enough to allow someone to evaluate the issue.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Can't post because of confidential data? Make a copy, delete data, input some dummy records for testing. If it's large, eliminate all but the objects relevant to this issue. Be sure to Compact & Repair before uploading. Everything you describe seems reasonable but it's hard for me to follow the issue by narrative, really helps to 'follow the code'. This sounds complex enough I am not going to try to recreate tables for testing based on your description. So unless someone else has insight, you are on your own.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    novicesupremo is offline Novice
    Windows Vista Access 2007
    Join Date
    May 2011
    Posts
    3
    Actually, I just solved the problem. What I didn't do was place a sub-group in the sub-report that included the licensee's name. After I did that and linked the master fields and the child fields, the sub-report functioned as desired.

    And I meant earlier that he wants to keep the structure as confidential as possible. I understand that re-constructing this table would be cumbersome. In the future, I will ask my boss if he would allow me to upload just one or two of the tables so that I can get any problems I have solved.

    Thanks again!

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

Similar Threads

  1. Report w/ Subreport locks up Access 2007
    By guyc in forum Reports
    Replies: 4
    Last Post: 05-12-2011, 09:22 AM
  2. Combine Main Report with subreport
    By jortizz in forum Reports
    Replies: 2
    Last Post: 05-05-2011, 12:42 PM
  3. Replies: 4
    Last Post: 03-14-2011, 11:12 PM
  4. Replies: 3
    Last Post: 06-23-2010, 02:02 PM
  5. Report and Subreport
    By newbie in forum Reports
    Replies: 0
    Last Post: 02-16-2010, 12:14 PM

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