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
ghadley_00@yahoo.com
Allen Browne - 06 Feb 2006 03:48 GMT
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.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> 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
[quoted text clipped - 10 lines]
> George Hadley
> ghadley_00@yahoo.com
ghadley_00@yahoo.com - 06 Feb 2006 22:33 GMT
Exactly what I needed - worked like a charm - thanks!
-GH