Highlight found words

J

jo

Could anyone help me with the following:-
I am designing a search form based on "Cool Search Tool" found via
http://www.access-programmers.co.uk/forums/showthread.php?t=120366. The
problem I have is that I need the found records to highlight the search word
in their respective field (Highlight All Instances of Found word). I would
not need the text box containing the search word to be highlighted but would
need each in my case six memo boxes to highlight each found word e.g. both
“A’s” in my code example I found on the net.
If this is not possible a control that I can click on to step through the
fields and each occurrence of the word within the field a bit like the find
control within access.
Dim SearchStr As String
SearchStr = "a"
If IsNull(Me.Text1.Value) Then
Me.Text1.Value = "this is a test example for a Cat"
Me.Text1.SetFocus
Me.Text1.SelStart = InStr(1, Me.Text1.Value, SearchStr) - 1
Me.Text1.SelLength = Len(SearchStr)
Else
Me.Text1.Value = Null
End If
Thank you for any help
 
M

Mike Painter

Could anyone help me with the following:-
I am designing a search form based on "Cool Search Tool" found via
http://www.access-programmers.co.uk/forums/showthread.php?t=120366.
The problem I have is that I need the found records to highlight the
search word in their respective field (Highlight All Instances of
Found word). I would not need the text box containing the search word
to be highlighted but would need each in my case six memo boxes to
highlight each found word e.g. both "A's" in my code example I found
on the net.

FMS has an RTF memo box available.
Probably cheaper to switch to Access 2007 which also allows it.
 
J

jo

Thank you for the feedback. Unfortunately 2007 is not an option at the
moment.
Hence is there not a way of elaborating the code in the example in my
original post to achieve my objective?
 

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