Autocomplete form field in MS Access Database

  • Thread starter Thread starter ghadley_00
  • Start date Start date
G

ghadley_00

Hi,

I have an access database with forms. I was wondering if there was a
way to make a form field do an autocomplete action during data entry
based on values already in that field for other records? In other
words, if I were to enter the letter J into a field, an autocompletion
of the alphabetically first entry in the table for that field beginning
with J is filled in, and the list would get refined based on further
letters entered.

Any help any one could provide would be greatly appreciated.

Best wishes,

George Hadley
(e-mail address removed)
 
Could use use a combo box on this field with properties:
Control Source: Field1
RowSource: SELECT DISTINCT Field1 FROM Table1 ORDER BY Field1;
Limit To List: No
where Field1 represents the name of the field in Table1.

If you want to do it with a text box, you would need to use its Change event
to open a recordset and get the first match (using the Like operator), and
set the Text property of the box. Then use SelStart and SelLength to select
the remaining characters so the user can continue typing.
 
Back
Top