Solved Highlight Matching keywords with red Color. (1 Viewer)

smtazulislam

Member
Local time
Today, 23:12
Joined
Mar 27, 2020
Messages
806
Hello, I have a Search Form and two search textboxes.
I want to two textboxes keyword search Highlighting in this subform with red Color.

my Subform is not Query or SQL. It has an expression into Control Source.
any help be appreciated.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:12
Joined
May 7, 2009
Messages
19,169
can you use Conditional Format?
 

smtazulislam

Member
Local time
Today, 23:12
Joined
Mar 27, 2020
Messages
806
can you use Conditional Format?
Thanks arnel. Can't use conditional format. because this is an expression ref to display not data type.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:12
Joined
Feb 19, 2013
Messages
16,553
my Subform is not Query or SQL. It has an expression into Control Source.
subforms do not have controlsources, they have sourceobject. Do you mean a listbox?
 

smtazulislam

Member
Local time
Today, 23:12
Joined
Mar 27, 2020
Messages
806
subforms do not have controlsources, they have sourceobject. Do you mean a listbox?


subform textbox Control Sources :
Code:
=([cName] & " " & "◄►" & " " & "Hex #:" & " " & [hex] & " " & "◄►" & " " & "RGB" & " " & "[" & "R=" & [R] & " " & "G=" & [G] & " " & "B=" & [B] & "]" & " " & "◄►" & " " & "MS Access #:" & " " & [a])

Form SQL like that:
Code:
SELECT Colors.ID, Colors.cName, Colors.hex, Colors.cInitial, Colors.R, Colors.G, Colors.B, Colors.A
FROM Colors
ORDER BY Colors.cName;
 

smtazulislam

Member
Local time
Today, 23:12
Joined
Mar 27, 2020
Messages
806
Here output is one color via 4 Method,
I doubt that I don't explain you's guy as well, so, I upload this db.
 

Attachments

  • Color.accdb
    548 KB · Views: 261

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:12
Joined
May 7, 2009
Messages
19,169
I only add Conditional Format to ColorName
 

Attachments

  • Color.zip
    77.8 KB · Views: 277

CJ_London

Super Moderator
Staff member
Local time
Today, 20:12
Joined
Feb 19, 2013
Messages
16,553
if you put your formula into your subform recordsource you can use richtext to highlight the search text. See attached - not I have disabled most of your code to demonstrate the principle.
 

Attachments

  • Color (1).accdb
    640 KB · Views: 254

smtazulislam

Member
Local time
Today, 23:12
Joined
Mar 27, 2020
Messages
806
if you put your formula into your subform recordsource you can use richtext to highlight the search text. See attached - not I have disabled most of your code to demonstrate the principle.

Thank you so much for help. Exactly I wanting like that, but it not shake when Type data, I put it ON CHANGE event but not being good result. and you see also HEX search box not work. I try to requery but not success.
if more help would be greatly appreciated.
 

smtazulislam

Member
Local time
Today, 23:12
Joined
Mar 27, 2020
Messages
806
I only add Conditional Format to ColorName
Thanks for help, I appreciate.
I apologize to say, I wanting letter will be RED color when searching. But your suggestion also good and colorful. Thanks again.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:12
Joined
Feb 19, 2013
Messages
16,553
it is just an example since it is not clear to me the real requirement - you will need to modify code to include Hex - or you could just put a hex value in the search text box and change the label caption to something like 'Search'
 

CJ_London

Super Moderator
Staff member
Local time
Today, 20:12
Joined
Feb 19, 2013
Messages
16,553
if you want to use the change event, in the query you need to reference the .text property of the control
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:12
Joined
May 7, 2009
Messages
19,169
see FrmSearch2 and the code behind.
i added another field DisplayText, the content
of which is the Original display of the textbox on subform.
you cannot highlight it since it is continuous form and
the Textbox need to be Bound.

theres a lot of code just to have a makeup.
 

Attachments

  • Color.zip
    52.4 KB · Views: 270

smtazulislam

Member
Local time
Today, 23:12
Joined
Mar 27, 2020
Messages
806
see FrmSearch2 and the code behind.
i added another field DisplayText, the content
of which is the Original display of the textbox on subform.
you cannot highlight it since it is continuous form and
the Textbox need to be Bound.

theres a lot of code just to have a makeup.
Thanks you so much arnelgp . its great looking now. I see On_Change Event in your code. But why data not sorting when I typing search boxes. Can you check it again please.
If not sorting, dont have benefit, Bcoz there have 200+ rows.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:12
Joined
May 7, 2009
Messages
19,169
check if this will sort.
 

Attachments

  • Color.zip
    68.7 KB · Views: 213

smtazulislam

Member
Local time
Today, 23:12
Joined
Mar 27, 2020
Messages
806
check if this will sort.
No work.
I meant, when I typing in the search boxes then subform data will be sorting which data has matched, if not match subform will blank. but here not changing subform data.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:12
Joined
May 7, 2009
Messages
19,169
I thought you only wanted to Sort.
test again.
 

Attachments

  • Color.zip
    86.7 KB · Views: 138

Users who are viewing this thread

Top Bottom