Displaying Filter Criteria In Report Header?

J

jutlaux

I have one report layout "rptStandard" that when it is opened I would like to
display the filter criteria in the header. Is there a way to do this?
 
A

Allen Browne

You can put this into the ControlSource of a text box:
=[Report].[Filter]

Trouble is, sometimes the Filter property contains an artifact from a
previous filter, even though the filter is not applied. On a form you could
sort this out by testing the FilterOn property, but Access doesn't maintain
this property reliably for reports.

A better solution is to pass the filter to the report in its OpenArgs (or
use a public string variable for Access 2000 or earlier.) Here's some sample
code that does that (as well as some other stuff):
http://allenbrowne.com/AppPrintMgtCode.html#OpenTheReport
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top