By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,148 Members | 739 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,148 IT Pros & Developers. It's quick & easy.

Display Search Terms in Report

P: n/a
Does anyone know a way to have the search parameters displayed in the
query or report? For example, if I set up a parameter to search all
entries in my table, is there a way to have the search terms I entered
displayed next to those entries? I would like to search with multiple
parameters (multiple search words) and have the results show me which
entries were found with which corresponding search words. Any help
would be greatly appreciated!

Jun 4 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If you use a query with a parameter in the Criteria row, such as:
[Enter a search word]
then you can display the user's entry on your report with a text box that
has its Control Source set to:
=[Enter a search word]

If you are programmatically building up a WhereCondition to use in
OpenReport, the string will be passed to the report as its Filter property,
so you can use a text box with Control Source:
=[Report].[Filter]
The trouble with that is that it might display a spurious string (typically
the last one used), even if the report is not filtered. And you can't avoid
that by testing the report's FilterOn property, since Access does not
maintain that property reliably.

Therefore you will need to build up another string to use as the description
of the filter, and pass it to the report using OpenArgs (Access 2002 and
later) or a public string variable. There's an example of opening a report
like that here:
http://allenbrowne.com/AppPrintMgtCo...#OpenTheReport

--
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.

<Re****@gmail.comwrote in message
news:11*********************@q19g2000prn.googlegro ups.com...
Does anyone know a way to have the search parameters displayed in the
query or report? For example, if I set up a parameter to search all
entries in my table, is there a way to have the search terms I entered
displayed next to those entries? I would like to search with multiple
parameters (multiple search words) and have the results show me which
entries were found with which corresponding search words. Any help
would be greatly appreciated!
Jun 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.