The WhereCondition of the OpenReport action turns up as the Filter property
of the report.
You could therefore display it on the report with a text box that has
Control Source of:
=[Report].[Filter]
Unfortunately, the report's Filter property may contain a left over value
from a previous filter, even if no filter is applied. You should get around
this by testing the report's FilterOn property, but there is a bug in Access
and the FilterOn property is not maintained reliably for reports. (FilterOn
is always set correctly for forms, but not for reports.)
In Access 2002 and later, you could repeat the WhereCondition in the
OpenArgs argument of OpenReport, i.e.:
DoCmd.OpenReport "MyReport",acviewpreview, ,strWhere, , strWhere
and then display it on the report with:
=[Report].[OpenArgs]
In older versions, you could set a public string variable (one declared in
the General Declarations section of a standard module) to the
WhereCondition, and use the Report Header's Format event to read the
variable, assign its value to an unbound text box, and then clear the
string.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Tom Louchbaum" <tw*@uwm.edu> wrote in message
news:41**************@uwm.edu...
Can someonw pls tell me how to reference the Where clause made by the
VBA statement
DoCmd.OPENREPORT "Report",acviewpreview,,where
as a control within the Report itself?