Subreport Help

bloodycape

New member
Local time
Today, 08:17
Joined
Aug 16, 2005
Messages
6
I'm new to access, I've done database work before just not with this package, I have only one small problem and this should be an easy one...

Without going into too much detail, i have a report that generates a list and calculates a few totals based on a date range inputed by a user. (I do this by using the "Between[Report Start Date] and [Report end Date]" statement as my criteria for the DATE field in my SQL statement.)

Inside that report i would like to include a subreport which summarizes the data of the main report. this subreport needs to display data based on the same date range as the main report. I simply cannot figure out how to get the subreport to use the same date range without prompting the user to type it in twice. I have another report that generates a subreport based on a users last name, this subreport works just fine ( I think this is because there is only one user inputted field and not two as with the date range.)

Both the subreport and the main report calculate the correct data when run independently, so I am confident they whole thing will work as soon as I know how to share the user inputted criteria.

If you have any answers please reply ASAP, it would be really appriciated.
 
Try adding Text Boxes to Main Report

In a Microsoft Access database (.mdb), create the criteria parameters in the report's underlying query.
Open the report in Design view.

Create an unbound text box for each parameter you want to display. Click the Text Box tool in the toolbox, and then click in the report header. These can be hidden if yu don't want them displayed.

To display the property sheet, make sure the text box is selected, and then click Properties on the toolbar.

In an Access database, set the ControlSource property to the parameter(s) you specified in the Criteria cell in the query. For example, if the parameters in the query are:
Between [Type a beginning date] And [Type an ending date]

and you want to display them in two text boxes, set the ControlSource property of one text box to:

[Type a beginning date]

and the ControlSource property of the other text box to:

[Type an ending date]



After, set the underlying query of your Sub report to point to the Text Boxes on your main report. This can be done by going into Query Builder for your sub report's query and Right Clicking in the Critria Row. Choose Build. Expand the Reports folder Below. Expand All Reports. Choose your main report and then select the Text Box you placed on your Main Report for the respective criteria.
 

Users who are viewing this thread

Back
Top Bottom