A valid SQL WHERE clause
(without the word WHERE) or expression that Access uses to
select records from the report's underlying table or query. If
you select a filter with the Filter Name argument, 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 255
characters. If you need to enter a more complex SQL WHERE clause
longer than this, use the OpenReport method of
the DoCmd object in Microsoft Visual Basic
instead. You can enter SQL WHERE clause
statements of up to 32,768 characters in Visual Basic. |