0
votes

Ok I want to build a report that includes several sub reports, all of the sub reports will be basically the same thing but the control source will change and one label will change. What I want to be able to do is use access VBA to duplicate the one report change the name of the new report and change the control source and label. Now I also want to use VBA to Put certain sub reports into the main report, so lets say I build it with all sub reports, but in a user form a person wants to omit data, then the VBA code would essentially delete certain sub reports or insert certain sub reports to the main report, the dimensions for all sub reports would be the same. Any ideas?

1

1 Answers

-1
votes

You probably have two options. 1. Create lots of sub-reports which are each used once in the one big main report. 2. Otherwise put the one sub-report in the detail section of the main report and vary the label and data as the report moves from one detail record in the record source to the next.

To give the user choice of which data to include, vary the query that the main report uses. Either with a parameter query, TempVars or a WHERE statement in the code that runs the report.

To give the user choice over which sub-reports are included, put code in the report load event to make some of the sub-reports not visible.