Solved Highlight Matching keywords with red Color.

smtazulislam

Member
Local time
Today, 11:27
Joined
Mar 27, 2020
Messages
808
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.
 
can you use Conditional Format?
 
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?
 
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;
 
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

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

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.
 
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.
 
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'
 
if you want to use the change event, in the query you need to reference the .text property of the control
 
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

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.
 
check if this will sort.
 

Attachments

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.
 

Users who are viewing this thread

Back
Top Bottom