Sub-Report, or other method?

C

clamfuddle

Hi.

How can I pass a parameter to both the Report and the Sub-Report?

I have two queries based on the same table and I want them to use the same
date (set up as a parameter that the user is asked at selection time).
My report has one as the main report and the other query as a sub-report.

Unfortunately, this combination asks me the date like 4 different times
prior to
actually creating the report.

What am I doing wrong? Any other suggestions?

Thanks!

Bryan
 
R

Rick B

You would need to build a small form with an unbound field. Have this field
open when the report is requested. In your queries and report, pull the
value from the field. Have a button on the form that wqill allow the user
to make an entry and then have the form hide itself.

In the reports onclose property, set the value of the field to "" so it will
be blank when the next user opens it, and then have the form close.

Rick B



"clamfuddle" <vader1 at flash.net> wrote in message
Hi.

How can I pass a parameter to both the Report and the Sub-Report?

I have two queries based on the same table and I want them to use the same
date (set up as a parameter that the user is asked at selection time).
My report has one as the main report and the other query as a sub-report.

Unfortunately, this combination asks me the date like 4 different times
prior to
actually creating the report.

What am I doing wrong? Any other suggestions?

Thanks!

Bryan
 
P

PC Datasheet

It's very likely since you need the same date in the main report and the
subreport that you may need a redesign of your tables. If designed correctly,
the subreport will track the main report. This means that when you display a
record for a selected date in the main report, the records for the same date
should automatically be displayed in the subreport.
 
C

clamfuddle

I don't think I follow -

If I don't have a date criteria in the subreport (tied to a query), it pulls
every record
in the table that matches that client, etc. But not by date.

What I have done:

Created query1 that includes and groups on Client, Subproject, SaleType and
Count(SaleType) -
with a parameter called [SALE_DATE] that causes a dialog box to pop up.

Created query2 that has the same data, but grouped differently (Client,
SaleType and Count(SaleType)
with a parameter called [SALE_DATE]. I was hoping that since it was a
sub-report that the SALE_DATE
given in query1 would be passed to query2 (same parameter name).

Then I created a report based on query1, and inserted query2 as a sub-report
in the client footer.

What I want to happen - launch the main report - it triggers the dialog box
to ask for the sale date and
then it creates the report that matches this date.

What I get - launch the main report, it triggers the dialog box 6 or 7 or
more times and then finally creates
the report that matches this date. But if I go to page 2, I get the dialog
box again.

I'm pretty good on queries, and tables and such - just have never had much
reason to do formal "reports"

Lost in space, and THANK YOU for helping me with this problem.

Bryan
 
P

PC Datasheet

I can't tell from the info you provided exactly what you are doing. The main
report should pull up sales records for a particular date. The subreport should
pull up the details of each sales record. As you navigate from sales record to
sales record in the main report, the subreport should track the main report with
out any user input.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



clamfuddle said:
I don't think I follow -

If I don't have a date criteria in the subreport (tied to a query), it pulls
every record
in the table that matches that client, etc. But not by date.

What I have done:

Created query1 that includes and groups on Client, Subproject, SaleType and
Count(SaleType) -
with a parameter called [SALE_DATE] that causes a dialog box to pop up.

Created query2 that has the same data, but grouped differently (Client,
SaleType and Count(SaleType)
with a parameter called [SALE_DATE]. I was hoping that since it was a
sub-report that the SALE_DATE
given in query1 would be passed to query2 (same parameter name).

Then I created a report based on query1, and inserted query2 as a sub-report
in the client footer.

What I want to happen - launch the main report - it triggers the dialog box
to ask for the sale date and
then it creates the report that matches this date.

What I get - launch the main report, it triggers the dialog box 6 or 7 or
more times and then finally creates
the report that matches this date. But if I go to page 2, I get the dialog
box again.

I'm pretty good on queries, and tables and such - just have never had much
reason to do formal "reports"

Lost in space, and THANK YOU for helping me with this problem.

Bryan

PC Datasheet said:
It's very likely since you need the same date in the main report and the
subreport that you may need a redesign of your tables. If designed correctly,
the subreport will track the main report. This means that when you display a
record for a selected date in the main report, the records for the same date
should automatically be displayed in the subreport.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 
C

clamfuddle

OK, Thanks for trying - I'll keep plugging away.

Bryan

PC Datasheet said:
I can't tell from the info you provided exactly what you are doing. The main
report should pull up sales records for a particular date. The subreport should
pull up the details of each sales record. As you navigate from sales record to
sales record in the main report, the subreport should track the main report with
out any user input.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



clamfuddle said:
I don't think I follow -

If I don't have a date criteria in the subreport (tied to a query), it pulls
every record
in the table that matches that client, etc. But not by date.

What I have done:

Created query1 that includes and groups on Client, Subproject, SaleType and
Count(SaleType) -
with a parameter called [SALE_DATE] that causes a dialog box to pop up.

Created query2 that has the same data, but grouped differently (Client,
SaleType and Count(SaleType)
with a parameter called [SALE_DATE]. I was hoping that since it was a
sub-report that the SALE_DATE
given in query1 would be passed to query2 (same parameter name).

Then I created a report based on query1, and inserted query2 as a sub-report
in the client footer.

What I want to happen - launch the main report - it triggers the dialog box
to ask for the sale date and
then it creates the report that matches this date.

What I get - launch the main report, it triggers the dialog box 6 or 7 or
more times and then finally creates
the report that matches this date. But if I go to page 2, I get the dialog
box again.

I'm pretty good on queries, and tables and such - just have never had much
reason to do formal "reports"

Lost in space, and THANK YOU for helping me with this problem.

Bryan

PC Datasheet said:
It's very likely since you need the same date in the main report and the
subreport that you may need a redesign of your tables. If designed correctly,
the subreport will track the main report. This means that when you
display
a
record for a selected date in the main report, the records for the
same
date
should automatically be displayed in the subreport.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


"clamfuddle" <vader1 at flash.net> wrote in message
Hi.

How can I pass a parameter to both the Report and the Sub-Report?

I have two queries based on the same table and I want them to use
the
same
date (set up as a parameter that the user is asked at selection time).
My report has one as the main report and the other query as a sub-report.

Unfortunately, this combination asks me the date like 4 different times
prior to
actually creating the report.

What am I doing wrong? Any other suggestions?

Thanks!

Bryan
 

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