Solved

Access 2010 Report with 40 questions that each require a different subreport

Posted on 2010-09-12
8
566 Views
Last Modified: 2013-11-28
Within an Access Report, I have 40 questions. Each of the questions is listed within the Detail section of the report. For each of the questions, I need to be able to use a different subreport. How can I set up the subreport so that a different subreport is used for each of the forty questions.
0
Comment
Question by:James_Moroney
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 48

Assisted Solution

by:Dale Fye
Dale Fye earned 334 total points
ID: 33656175
Can you explain what is in the sub-reports?

I don't have 2010, so this is mere speculation, but normally for something like this they would all be in a similar format, and would only be filtered by the the field that is linked as the ID field on the main report.  Or maybe to the ID field, and the Question #.

You might be able to use the detail sections Format event to change the SourceObject of the subreport, something like:

Private Sub Detail_Format

   Select Case me.txt_Question
        Case 1, 3, 7, 10
            me.subReportControlName.Report.ControlSource = "rptQuestionYesNo"
        Case 2, 4, 8
            me.subReportControlName.Report.ControlSource = "rptQuestionTextResponse"
        Case 5, 6, 9
            me.subReportControlName.Report.ControlSource = "rptQuestionPickOne"
        Case 11 to 15
            me.subReportControlName.Report.ControlSource = "rptQuestionMultiResponse"
     End Select
End  Sub

If you actually have 40 different subreports, you could use an If statement instead of the Case statement.

You might also have to modify the child/master link fields to ensure that each of the subreports will be filtered to reflect the correct question.


       
0
 
LVL 6

Expert Comment

by:JVWC
ID: 33656380
40 Different subreports suggests the info will be from 40 different tables!
I expect the aswer to your Q will be in the table/query structure.
Are you able to upload a sanitised sample of your DB?

Cheers
JC
0
 
LVL 30

Expert Comment

by:hnasr
ID: 33658639
Why not use grouping? Unless your setup is different from normalized data!
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

Author Comment

by:James_Moroney
ID: 33658829
The data for each of the subreports comes from 40different tables. Collectively, the data for the different subreports cannot be normalized into a common table. Each of the 40 questions deals with a different subject matter.

The suggestion to use a case statement (or If-Endif) would be very helpful. However, the "Source Object" tab within the Property Sheet for an unbound subreport seems to only permit selection of a single and specific choice for the data source. Where would I put the vba code for the case (or if-endif) statements? Thanks in advance.
0
 
LVL 58

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 166 total points
ID: 33658884
<<The data for each of the subreports comes from 40different tables. Collectively, the data for the different subreports cannot be normalized into a common table. Each of the 40 questions deals with a different subject matter. >>
  FWIW, generally that's not the case.  It's just a matter of structuring it right.  If you haven't gone too far with the design, you might want to post a question looking for some ideas on how to re-structure.
JimD.
0
 
LVL 48

Accepted Solution

by:
Dale Fye earned 334 total points
ID: 33658976
Agree with JD, it is rare that you would need 40 different tables.  There are really only a few types of questions when it really comes down to it.  Check out:http://www.rogersaccesslibrary.com/forum/at-your-survey_topic3.html
for a really good example of a survey database.
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 34118946
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question