Opening Subreports with dates

D

Don Sealer

I have a report that includes 5 different subreports. I'd like to be
able to open this report using a date function (Start Date and End Date).
I'd like all five subreports to show the data from those dates. I have
learned how to use this start/end function but I can't figure out how to use
it with these subreports. Right now the report opens but asks for start/end
dates for each of the five reports. Is there a way I can input one set of
dates and have all five reports show up using the same dates?
I hope I haven't confused this.
I'm also using a form switchboard for activating this report, if
switchboard is the correct word. The switchboard at this time has 4
different reports that can be accessed. The first three are very basic
reports so when I use the start/end date function it works very well for the
individual report I'm trying to access. However the report that has the
five subreports is more difficult. I guess I could input a start/date for
each of the five subreports but that seems to be very time consuming and
wasteful. I'm sure there is a way to do this I just don't know how.
I'll bet now I've confused the issue. If so let me know and I'll try a
different approach.
Thanks for your continued help,
Don.......
 
A

Allen Browne

o enter the dates once for all subreports, you need to get them to read the
dates from a form. It can be your switchboard, or a form designed
specifically form the purpose.

Let's assume you have a form named "Switchboard", with text boxes name
txtStartDate and txtEndDate. Set the Format property of these text boxes to:
Short Date
so Access won't accept any invalid date.

Now open the query that is the RecordSource for your first subreport. In
query design, choose Parameters from the Query menu. Access opens a dialog.
Enter two rows, like this:
[Forms].[Switchboard].[txtStartDate] Date/Time
[Forms].[Switchboard].[txtEndDate] Date/Time

Repeat for the other subreports.

Now when you open the main report, each of the subreports will read the
dates from the form. This assumes that the form is open and the dates are
filled in when you run the report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top