HighXplosive
New member
- Local time
- Today, 14:50
- Joined
- Aug 25, 2008
- Messages
- 9
I have a set of reports:
- Each report contains subreports.
- All reports and subreports contain listboxes.
- All listboxes are bound to various queries.
- All queries reference directly to the database, not derived tables.
- All sub-reports are bound to a query.
- All parent reports are NOT bound to any "RecordSource".
I need to:
- Allow a user to input 2 dates.
- Limit the data that is used by the queries embedded in above said reports to those within the 2 dates.
- The date is held in a table called Case: Case is not an isolated table, it has various relationships of differing degrees.
I have constructed an expression to 'limit' the range of data that should be examined by these reports and their embedded queries:
WHERE (((Case.OpenDate) Between forms!InputDateRange!FromDate And forms!InputDateRange!ToDate));
It fails to work:
- in a Macro WHERE condition as part of the OpenReport command because logically, the queries that are embedded bypass this condition and extract the data from the database direct.
- in a Query that is executed prior to the report being opened, logically because of the same reason as above.
The expression works when it is inserted into the embedded queries themselves: meaning the queries act on the expression embedded inside them with the input drawn from the preceding "InputDateRange" form.
The problem with this is that I have already constructed most of the queries with the intention to "filter out" records by the date range, THEN have the queries apply. I did not intend to filter out the records by embedding the above said expression into each and every query as:
- it would require too much time.
- it would cause further unnecessary complexity.
Therefore, I am looking for a solution to this that will, logically, impose the date range before applying the queries embedded to each of the controls in the reports. The key issue is that the queries embedded query the database directly, not a derived table or set of tables.
- Each report contains subreports.
- All reports and subreports contain listboxes.
- All listboxes are bound to various queries.
- All queries reference directly to the database, not derived tables.
- All sub-reports are bound to a query.
- All parent reports are NOT bound to any "RecordSource".
I need to:
- Allow a user to input 2 dates.
- Limit the data that is used by the queries embedded in above said reports to those within the 2 dates.
- The date is held in a table called Case: Case is not an isolated table, it has various relationships of differing degrees.
I have constructed an expression to 'limit' the range of data that should be examined by these reports and their embedded queries:
WHERE (((Case.OpenDate) Between forms!InputDateRange!FromDate And forms!InputDateRange!ToDate));
It fails to work:
- in a Macro WHERE condition as part of the OpenReport command because logically, the queries that are embedded bypass this condition and extract the data from the database direct.
- in a Query that is executed prior to the report being opened, logically because of the same reason as above.
The expression works when it is inserted into the embedded queries themselves: meaning the queries act on the expression embedded inside them with the input drawn from the preceding "InputDateRange" form.
The problem with this is that I have already constructed most of the queries with the intention to "filter out" records by the date range, THEN have the queries apply. I did not intend to filter out the records by embedding the above said expression into each and every query as:
- it would require too much time.
- it would cause further unnecessary complexity.
Therefore, I am looking for a solution to this that will, logically, impose the date range before applying the queries embedded to each of the controls in the reports. The key issue is that the queries embedded query the database directly, not a derived table or set of tables.