Highlight Found text in subform

  • Thread starter Thread starter Alan Z. Scharf
  • Start date Start date
A

Alan Z. Scharf

1. I would like to highlight found text in a textbox field in s subform.

2. I have code which resets the record source for a form to a SQL query
with
a parameter of the search text typed in to an input box. The subform then
displays only the records that meet the search text criterion.

3. Hence, for each record displayed with the navigation forward/back
arrows,
I would like to highlight the found search text in the textbox.

4. This probably has to be done in the OnCurrent event, but I'm not sure
how
to specifically highlight the serch text.

Thanks.

Alan
 
Firstly, you cannot hightlight one word out of the text in a text box in
Access. That requires the use of rich text, which is quite different from
pure text. You can download a rich text box from www.lebans.com, but it
would also require you to alter the text in the field to achieve the
highlighting, and then you would need to change it back again later.

If the subform is in Continuous or Datasheet view, you cannot use the form's
Current event, because this will refer to the values in the current record
only. It might be possible to programmatically assign the FormatCondition to
the control based on whether it is Like the text you want to find. Sounds
messy though - especially if there are several fields where the value could
be found. Conditional Formatting is available only in Access 2000 and later.
 
Allen,

Thanks for your reply and the reference to the RFT field.

I can't implement that right now in a working database.

I'm trying to highlight the found text in a text box on regular Access 2003
form, not continuous or datasheet.

Only one field being searched.

Any other ideas would be welcome.

I checked Google but didn't fnd anything.

Alan
 
You cannot bold (or highlight) one word in a text box.
It's a basic limitation of the the control.
 
Back
Top