As input is typed into a text box, I would like to search a recordset for the
first record that matches what has been typed so far. I would like to update
the text box to display the letters typed by the user in the normal font and
any additional characters in the first matching record displayed as highlighted
text. This matches the action of the MS Access help index.
I can use the OnKeyPress event to trigger a new check for the "best" match with
the recordset as input proceeds. I can display the input only but the user
can't tell if a match to what is being input has been found. I can store the
user input and display the recordset match, so both are still available in the
program. If I display the recordset value, it isn't obvious what has been input
so far (in other words, EXACTLY where the last letter typed is in the displayed
string)
I can display the best recordset match in a separate text box but my form is
already crowded.
I could use a combo box, opened programatically using the DropDown Method, and
programatically modifying the combo box list based on the current input string
and recordset values. The input field displays what has been typed so far and
the dropdown list shows only the first "likely" match from the recordset. I
find this method a little awkward.
How can I display the actual user input in the normal font and, in the same
text box, display the remainder of the "best" recordset value-if any?
Also, where will the cursor be? If the user types another letter with this
modified display in the text box, will the result be to add the new Key value
to the end of the previous user input or to the end of the recordset value
(which is displayed in mixed fonts). It seems, based on normal text box
behavior, I will need to catch the value of each Keypress and append it to the
user stored input string before searching the recordset for the best match.
Thanks in advance for any help.
Paul Core 2 4749
On 10 Apr 2004 18:07:37 GMT, co******@aol.combvwertz (Corepaul) wrote:
I like a variant on your combobox approach: in the OnChange event wait
until at least 3 characters are typed, then start requerying the
back-end and display any hits (use the LIKE predicate in your query).
-Tom. As input is typed into a text box, I would like to search a recordset for the first record that matches what has been typed so far. I would like to update the text box to display the letters typed by the user in the normal font and any additional characters in the first matching record displayed as highlighted text. This matches the action of the MS Access help index.
I can use the OnKeyPress event to trigger a new check for the "best" match with the recordset as input proceeds. I can display the input only but the user can't tell if a match to what is being input has been found. I can store the user input and display the recordset match, so both are still available in the program. If I display the recordset value, it isn't obvious what has been input so far (in other words, EXACTLY where the last letter typed is in the displayed string)
I can display the best recordset match in a separate text box but my form is already crowded.
I could use a combo box, opened programatically using the DropDown Method, and programatically modifying the combo box list based on the current input string and recordset values. The input field displays what has been typed so far and the dropdown list shows only the first "likely" match from the recordset. I find this method a little awkward.
How can I display the actual user input in the normal font and, in the same text box, display the remainder of the "best" recordset value-if any?
Also, where will the cursor be? If the user types another letter with this modified display in the text box, will the result be to add the new Key value to the end of the previous user input or to the end of the recordset value (which is displayed in mixed fonts). It seems, based on normal text box behavior, I will need to catch the value of each Keypress and append it to the user stored input string before searching the recordset for the best match.
Thanks in advance for any help.
Paul Core
In my post, I forgot to mention that I am an Access newbie. After my post, I
continued to look around and found my answer in the Access VB Help file. The
SelLength and SelStart functions are the key.
I can store user input, keystroke by keystroke, in a local variable and display
the first recordset string whose beginning characters exactly match the current
user input. Set textbox.SelStart equal to the length of the user input string.
Set textbox.SelLength equal to the length of the recordset string minus the
length of the user input string. This leaves the typed input in normal font and
the remainder of the recordset string "selected." This is exactly what I wanted
to acomplish!
I'll need to handle when no match is found in the recordset (setting SelLength
to a negative number causes a run-time error) and other error handling issues.
Sorry to add to the bandwidth, I really did look for an answer before I posted
my request for help. Hunting for things in the Access help files is hit or miss
for me. I didn't get lucky until after I had posted. But, having raised the
question, I thought I'd post the answer I found.
Paul Core This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: DettCom |
last post by:
Hello,
I would like to be able to display or hide fields based on whether a
specific Yes/No radio button is selected. This is in conjunction with
a posting a just made here in the same group...
|
by: dmiller23462 |
last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript
but my end result is I need two text boxes to stay hidden until a
particular option is selected....I've cobbled together the...
|
by: Corepaul |
last post by:
As input is typed into a text box, I would like to search a recordset for the
first record that matches what has been typed so far. I would like to update
the text box to display the letters typed...
|
by: David Elliott |
last post by:
I need a control on a Web Page that can accept an HTML Document and will display it.
Any help would be appreciated.
Thanks,
Dave
Here is what I was trying...
|
by: drew197 |
last post by:
I am a newbie. I am editing someone elses code to make it compatible
with Firefox and Safari.
In IE, when you click on the proper link, a block of text is shown in a
nice paragraph form. But, in...
|
by: Ron L |
last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the
data it scans comes through as if it was typed on a keyboard. I am trying
to have the data in the barcode be displayed in...
|
by: Bill Nguyen |
last post by:
I'm getting data from a mySQL database (default char set = UTF-8).
I need to display data in Unicode but got only mongolian characters like
this: Phạm Thị Ngọc
I changed the textbox font to...
|
by: rbinington |
last post by:
Hi,
I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I...
|
by: Dirk Loss |
last post by:
Hi,
I want to have tab completion in my program for interactive input.
Using readline and rlcompleter this works nicely. But I also have to
catch and modify all "print" output, so I redirect...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |