Solved

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

Posted on 2010-09-12
8
522 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 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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 57

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 47

Accepted Solution

by:
Dale Fye (Access MVP) 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 92

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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now