Partial search dialog box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello:
Is there a way to create a dialog box that searches by partial
entries...i.e. similar to those that jump to the beginning of a word as you
type. For example if I start entering "a" then the cursor will jump to the
first word that starts with "a" in the list, etc. I have a combo box that
searches by the number the user enters but I would like to do a partial name
or full name search since users aren't always sure of the spelling.
Thanks,
J.
 
You can do that in the Change event of the text box, and using the Text (not
Value) property of the control.

DLookup() the first match in the lookup table.
Assign the result to the Text property of the text box.
Set SelStart and LenLength based on the original Len() of the Text, so the
correct characters are overwritten as the user continues to type.

You will need some VBA skills to achieve this.
 
Thanks Allen.
I'll do some reading.
J.

Allen Browne said:
You can do that in the Change event of the text box, and using the Text (not
Value) property of the control.

DLookup() the first match in the lookup table.
Assign the result to the Text property of the text box.
Set SelStart and LenLength based on the original Len() of the Text, so the
correct characters are overwritten as the user continues to type.

You will need some VBA skills to achieve this.
 
Back
Top