Filter the results of a Form (query) to a Report 
Author Message
 Filter the results of a Form (query) to a Report

I have setup a form (FORM IS THE KEY WORD)to run a query, now what I am
trying to do is direct the results of the query to a report.  I can
direct the results from a query, but I am unable to direct the results
from the FORM to a report.  Thanks for any help!


Sun, 25 Aug 2002 03:00:00 GMT  
 Filter the results of a Form (query) to a Report
If the report has the same RecordSource as the form,
you can use the form's filter as the WhereCondition
of the OpenReport action, e.g.:

Dim strWhere as String
If Me.FilterOn Then
  strWhere = Me.Filter
End If
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere

If that's not the approach you are after, consider
basing the report on a query, and alter the SQL property
of the QueryDef before opening the report.

Quote:

> I have setup a form (FORM IS THE KEY WORD)to run a query, now what I am
> trying to do is direct the results of the query to a report.  I can
> direct the results from a query, but I am unable to direct the results
> from the FORM to a report.  Thanks for any help!

--
Perth, Western Australia
Tips for MS Access users at:
        http://odyssey.apana.org.au/~abrowne


Mon, 26 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Pass Result of a Query to a Report

2. Filtering reports from queries

3. Parameters in Queries vs Filters in Reports

4. Print results of query in Crystal Reports

5. Create a form to show new query result!

6. Field of form = result from query

7. Need help:menu item to save as query a filter by form

8. Query result into a form

9. display query results on form using VB

10. using a query result to run another query

11. Truncated values in results of query upon query

12. Truncated values in results of query upon query

 

 
Powered by phpBB® Forum Software