Solved Search keys became color

smtazulislam

Member
Local time
Today, 12:21
Joined
Mar 27, 2020
Messages
808
any help will appreciate.

I have a searcher form where SEARCH textbox as txtSearch and it on Event ONCHANGE ( ).
What I need, if I type any keys (English or Arabic font or any others font ) then subform (result ) is an indicate by a red or green colour. And count how many keys founded.

Note : 1) Searcher event work perfectly
2) here display only two languages.
 

Attachments

  • Capture1.JPG
    Capture1.JPG
    67.7 KB · Views: 104
can you upload a sample, so we can see what code you have so far.
 
There might be a way to do what you want, but it is not clear as to your situation. Your form mentions "whole book" as though you meant to find a word in a large document. Normally this would be done using MS Word but I don't want to make an assumption. Can you tell us what you are trying do AND in what context or with what document type?
 
Your form mentions "whole book" as though you meant to find a word in a large document. Normally this would be done using MS Word
Hello Sir, actually I have there two options
1) Specific by selected Chapter to find only which selected from combobox.
2) If combobox is NULL then find whole chapter what data entry have.

Like :
If me!txtSearchSpecificChapter = null then
'find whole book
if me!txtSearchSpecificChapter = not null then
'find selected specific chapter only
end if
 
can you upload a sample, so we can see what code you have so far.
this is my sample db


Edit:
Here I like to work this searcher like:
Firstly
If me!txtSearchSpecificChapter = null then
'find whole book
if me!txtSearchSpecificChapter = not null then
'find selected specific chapter only
end if

Secondly
if I type any keys then founded character is count how many character is it and
If I type complete a word then its also count ho many word founded.

I knew it maybe need more code. Please sir help with sample code that I understand step by step..
Thank you very much
 

Attachments

Yes, Perfect Sir.
little correction plz,
Code is not work where I selected combo "txtSearchSpecificChapter" code available but not debug/requery
Code:
Private Sub txtSearchSpecificChapter_AfterUpdate()
Me.sfrmSearcher.Form.Requery
End Sub
And
When I enter the complete a word in the textbox "txtSearchWholeBook" then lbCountWord is not count or display.
And
Need quote for each coding first a line why use debug plz. its help me to understand.
Thank you very much.
 
here i put some comments on the code.
 

Attachments

get error 94

1659614109222.png


Edit #
When select specific chapter then enter any key on the SEARCH textbox. then get long time loading.. last opening time 3 minutes.
 
replace with this in txtSearchWholeBook_Change() sub
Code:
' we get error when we get the .Text of the textbox when it is not in Focus
On Error Resume Next
strSearch = Me![txtSearchWholeBook].Text
If Err Then
    Err.Clear
    On Error GoTo 0
    ' assign it's value
    strSearch = Me![txtSearchWholeBook] & ""
End If
 
Hello Sir, I forget to asking that there is no string a colour in Search Subform when I enter the specific Word or Alphabet.
 
what do you want to color, Word or each Character?
 
i checked Verse table and both VerseTextAr and VerseTextEn are Short text.
you can't apply coloring to short text, you need to convert them first to Long Text.
 
i checked Verse table and both VerseTextAr and VerseTextEn are Short text.
you can't apply coloring to short text, you need to convert them first to Long Text.
Okay Sir, I agreed to convert them Short text to Long Text.
 
here it will change every character you type.
 

Attachments

Thank you very much sir, its nice work.
Can possible to do that ?
if searcher textbox enter completed word then
'those word is became Green
'And In-completed word is Red as you done.
end if
 
There is also facing problems that search form loading take time 1 to 2 minutes, sometimes more then and when enter any keys also result display taking long time where my total database 6.17 mb and record 6236.

How can resolve this issue... ?
 
display taking long time where my total database 6.17 mb and record 6236.
there is no fix.
you are checking the occurrence of a word/character on two Long Text fields.
every time there is a match, you need to add Color to it.
so i suggest you abandon this one.
 

Users who are viewing this thread

Back
Top Bottom