Avoiding each subreport asking for primary key

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main report with 4 subreports (one of which is nested inside another
one). All 5 reports are based on their own queries due to length of report
and the fact that 2 of them are based on multiple returns from a different
table than the other 3. (5 instead of 2 because a one-shot return has to go
in between 2 sets of multiple returns.) The report is run for only one
primary key # at a time, so I have the main report's query ask me for the
parameter.
I *had* thought that by pointing all my subreports' needs for the primary
key at the result of the main report's parameter, I'd avoid having to type
the parameter 5 times, but no - it actually wants it *7* times. :)

What's the correct way of using the main report's parameter result to bring
up the other 4 subreports correctly as well?
 
I could swear I just answered this yesterday.

Point your queries to a field on a form. Then the user can make the entry
one time in the form, click a button to produce the reports, and the query
will grab the data from the form, instead of asking for it.




Also, if all the queries pull from one query and that one query has the
parameter in it to limit the results, then you would not need the parameter
again in the other 5 queries.

In other words, let's say you had five reports. Report one pulls all red
widgets. Report 2 pulls all Red Gizmos, report 3 pulls all red whozits,
etc. Sometimes, you want to see green gizmos, widgets, and whosits, though.

Rather than put the criteria in the color column for each query, build one
query that pulls ALL objects and ask the user which color to pull. Then,
base your widget query on this big query, and your gizmo query would alos
pull from this big query, etc.

The big query would ask the color (once) and each additional query would
further limit which records are pulled based on other criteria, but they
would not need to ask the user for the color again since the underlying
(big) query already did that.

This scenario will not work in all cases.



Rick B
 
After reading again, it sounds like you may have left the parameter request
in the subsequent queries. If the main query already limits by this, then
don't put it in the more-detailed queries.
 
If you replied to my post 2 days ago, it didn't post. :(

It's been a while since I've created anything this complicated in Access,
being a part-time user, so thanks for reminding me I needed to point my
parameter request towards a form control once all the queries and reports
tested correctly individually. Thanks!
 
Back
Top