View Full Version : Multiple Reports with same Parameters


PaulR
01-08-2009, 07:14 AM
Hi All

I have seen similar posts regarding this and I have tried to work it out but I am still having problems - if anyone can help I'd be so grateful.

Here's what it is:

I have 3 queries - qryGData (all data) qryCountAge and qryCountGender (based on the qryGdata - this has Between [Forms]![frmDateRangeReport]![FromDate] And [Forms]![frmDateRangeReport]![ToDate] in the Date Criteria Field)

1 main report rptDateRangeSummary with the 2 subreports based on the 2 Count queries.

1 Form frmDateRangeReport to pass the parameters.

What I am trying to do is enter a to and from date once and the subreports display the data without being prompted again.

I have attached screenshots of my DB - of anyone can see any glaring errors I woudl be very pleased!

Thanks in advance.

Paul

rainman89
01-08-2009, 07:30 AM
Have you tried creating a form where you enter the to and from dates and then run the queries off of that form? you will be able to enter once and use those textboxes in all of the queries

PaulR
01-08-2009, 07:40 AM
Hi rainman89

I have created a form (3rd screenshot in attachment) with 2 unbound text boxes "FromDate" and "ToDate" - these are referenced in the date criteria of the main query. (1st screenshot) - the buttonruns a macro to open the report.

But the pop up to enter the dates keep coming up again!

rainman89
01-08-2009, 07:51 AM
unfortunately your pictures are too blurry for my eyes and i cant see exactly what is in the query.

Are you have the same part ([Forms]![frmDateRangeReport]![FromDate] And [Forms]![frmDateRangeReport]![ToDate] ) in each query for the date criteria?

PaulR
01-08-2009, 07:53 AM
Oh Sorry - I didn't realise they were too bad to read!

The Date criteria is not in the 2 count queries - it's in the main qryGdata on which they use. Shoudl I add it to the count queries rather than the underlying one?