Solved

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

Posted on 2010-09-12
8
545 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Documents and settings folder 30 78
Access report groups with sums 5 28
Calculate Time acces 2010 12 29
Experience with VBA code that changes unexplicably? 8 24
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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