passing filter arguments to sub-report

Ø

Øystein Sund

Hello!

How do I pass an argument to the filter property in a sub report?
Or is this a stupid way to filter a sub-report?


Sincerely
Oystein Sund
 
A

Allen Browne

You can assign the Filter property in the Open event of a report, but it
generally doesn't work very well with subreports.

Alternatives:
1. LinkMasterFields/LinkChildFields
If there is a match between a subform field and a field on the main report,
this is the simplest solution.

2. Form control nominated in criteria of subreport's RecordSource
Create a form where the user can enter the limiting values.
Set the RecordSource of the subreport to a query.
In the query, set the criteria to something like this:
=[Forms]![MyForm]![MyTextbox]

3. Rewrite the SQL property of the subreport's query before the report
opens.
 
Ø

Øystein Sund

Alternatives:
1. LinkMasterFields/LinkChildFields
If there is a match between a subform field and a field on the main report,
this is the simplest solution.

Doesn't do the job I want it to..

2. Form control nominated in criteria of subreport's RecordSource
Create a form where the user can enter the limiting values.
Set the RecordSource of the subreport to a query.
In the query, set the criteria to something like this:
=[Forms]![MyForm]![MyTextbox]

3. Rewrite the SQL property of the subreport's query before the report
opens.


Thanks! These two gave me the help I needed!


-
Oystein Sund
 

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