Action argument | Description |
|
(continued) Report Name | If you run a macro containing the OpenReport action in a library database, Microsoft Access looks for the report with this name first in the library database, then in the current database. |
View | The view in which the report will open. Click Print (print the report immediately), Design, or Print Preview in the View box. The default is Print. |
Filter Name | A filter that restricts the report's records. You can enter the name of either an existing query or a filter that was saved as a query. However, the query must include all the fields in the report you are opening or have its OutputAllFields property set to Yes. |
Where Condition | A valid SQL WHERE clause (without the word WHERE) or expression that Microsoft Access uses to select records from the report's underlying table or query. If you select a filter with the Filter Name argument, Microsoft Access applies this WHERE clause to the results of the filter.
To open a report and restrict its records to those specified by the value of a control on a form, use the following expression:
[fieldname] = Forms![formname]![controlname on form]
The fieldname argument is the name of a field in the underlying table or query of the report you want to open. The controlname on form argument is the name of the control on the form that contains the value you want records in the report to match. |
| Note The maximum length of the Where condition argument is 256 characters. If you need to enter a more complex SQL WHERE clause longer than this, use the OpenReport method of the DoCmd object in Visual Basic instead. You can enter SQL WHERE clause statements of up to 32,768 characters in Visual Basic. |