Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub Report Query Criteria

Status
Not open for further replies.

bill1856

Programmer
Sep 5, 2005
18
US
I have a report that contains 4 sub-reports. The sub-reports are a based on four seperate queries that rely on user input for the criteria - [Enter Date]. When I open the report, I have to enter the date I'm searching for four times. Is there any way to just enter it once?
 
There are multiple ways to accomplish this. One way is to remove the date selection criteria from the subreport queries and add the date to the link between the main reports and subreports. (This may be the easiest solution).

You could also reference a date on a form, or in a table or a number of other ways.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Can you insert the date field into the master report and its underlying query? Even if this seems counter-intuitive to the master report it can make things easier.
Within this Master query you can place your parameter [enter date]. Then place the date field on your Master report but set its visible properties to "No."
Now on your 4 subreports also place your date fields (again with visible properties set to "no"). From there it is just a matter of linking your parent/child fields to include Date and whatever else they were previously linked to. I know it isn't elegant but I think it is effective.
 
Maybe I'm going about this the wrong way.

I have the following four tables: Incident, Theft, MVC, and MVI. These tables hold data entered by users writing reports. I want to be able to run a summary of all reports for a date entered by a user with a report that looks like this:

Incident Reports

Report # Reporting Officer
(and all other incident reports for the day)

Theft Reports

Report # Reporting Officer
(and all other theft reports for the day)

Etc..

Is there an easier way to do this than with 4 sub reports?
 
I don't agree with any of these suggestions. Parameter queries should be avoided since they are inflexible and horribly user-unfriendly.

Use controls on forms for all of your criteria. Then set the criteria in queries to something like:
Forms!frmDate!txtRptDate

There are times when you can use Link Master/Child but this doesn't work with a date range, only single values.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top