[Webinar] Streamline your web hosting managementRegister Today


Bold and/or Color text in field from Wildcard Search

Posted on 2010-03-23
Medium Priority
Last Modified: 2013-11-29
I have a home grown Access 2003 app I developed for my company that stores incident reports for accidents and injuries. There are several free text fields in the report where managers enter personal accounts of the events by themselves as well as others that may have been involved. The idea of using Access was that I created many drop-down fields prompting managers for specific details about the event and stored them in a controlled way so reporting would be very easy to do -- Create me a report where I can choose "this" date range and "that" department for all accident types matching "this".  So, there are not 10 different mis-spellings of a department name, or an employee name, etc.
However, now I am being asked to create a wildcard search report where a free text phrase can be entered and then searched upon for all of the free-text fields in each record.  That's the easy part, and I have this already working.
What I am trying to do though is find a way, that when the report is generated, to show all the matching records and make it so the "searched upon phrase" is somehow bolded or have the text changed color so it stands out.  Since there are multiple text fields being searched, I'd like to give the user that is running the report a way to more easily pick out where it is in the report the phrase shows up that he/she was searching for.
I see this type of styling done on web searches for Google and other search engines all the time, but I have no idea how to do it with Access, or if it is even possible.

Can anyone suggest any options?
Question by:jmcclosk
LVL 77

Accepted Solution

peter57r earned 2000 total points
ID: 28367171
It's not possible using anything in standard Access 2003.

You would need a rich text control and then programmatically add in the rich text control strings around the matched text to highlight the occurrences.  How you would do that will depend on you finding a suitable rich text control and on it's method of operation.  There used to be a rich text control here www.lebans.com but I'm not sure if the site author is still around now.
LVL 85
ID: 28367443
I realize this may not be an option, but Access 2007 does provide native RichText formatting in a Textbox. You'd have to do this through code - that is, you'd have to parse the returned text and then surround that with HTML tags to bold it.

You could also use a WebBrowser control, which would allow you to do much the same as a webpage, and use the same concept - use the Replace function in your returned data to highlight the search phrases, then display them in the WebBrowser control.

Author Comment

ID: 28572741
Sorry guys.  I should have qualified my questions with the facts that, (1) I was trying to do this without resorting to the addition of any 3rd party software and (2) I don't have a budget to spend money on that or an upgrade to Office 2007.
Since there doesn't seem to be a resolution to my question, based on the fact that it seems the functionality is not available within Access 2003, I don't really know how to close out this question??  Do either of you feel your answers were worth the 500 pts assigned?

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
Audit trails are very important in any system to hold people responsible for certain transactions and hold them to take ownership of their actions. This article is dedicated to all novice "Microsoft Access" developers.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question