Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-09-12
8
Medium Priority
?
576 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
8 Comments
 
LVL 49

Assisted Solution

by:Dale Fye
Dale Fye earned 1336 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 31

Expert Comment

by:hnasr
ID: 33658639
Why not use grouping? Unless your setup is different from normalized data!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 664 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 49

Accepted Solution

by:
Dale Fye earned 1336 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

926 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