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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass dynamic parameter to subreport query 1

Status
Not open for further replies.

Jenke

Programmer
Nov 12, 2002
15
CA
Hi all.

Im using a report that returns job information, names, complexity. etc.

One of the groups (complexity) has a subreport in it.
the subreport needs to perform calculations for totaling, etc. based on individual complexity ratings.

I am using a an SQL query as the source for the subreport.

How would i pass the complexity value to the subreport query (Or, how would i access a field on the parent report from the subreport) in order to have the SQL query use the appropriate where clause?

ie..
for the group where complexity = 1, the subreport needs to be something like 'SELECT * from projects WHERE complexity = 1'
for the group where complexity = 2, the subreport needs to return 'select * from projects where complexity = 2' and so on and so forth

Any help would be appreciated

Thanks,

Jon
 
Use the Link Master/Child properties to limit the records displayed in a subreport to a value from the main report.

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]
 
Duane: Thanks.. I was trying that but couldnt get it going.. Your advice put me back on track though..

I wasnt including the complexity in the select statement in the subreport, so i couldnt link w/ the child/master link fields

i altered the sql to include complexity, then placed hidden fields in the groupheader of the main, and complexity of detail and was able to link to them.

now it works great :) feel kind of dull for not thinking of it before though :S

Thanks again,

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top