Can Microsoft Access autocomplete fields?

Tukai Nancy picture Tukai Nancy · Mar 6, 2013 · Viewed 19.3k times · Source

I'm using Microsoft Access 2007. When I start typing a new record,is there a way to get access to suggest things I've previously typed, to save me time typing the whole word in? For example when I start typing S, it might start suggesting words that I've already typed beginning with S, then if I type ST it might suggest STATION and I can just press enter to insert that word?

Answer

HansUp picture HansUp · Mar 6, 2013

Your question includes a tag for combobox; seems to me that could be the most inexpensive solution.

Make the combo row source a query:

SELECT DISTINCT YourField
FROM YourTable
ORDER BY YourField;

With the combo's "limit to list" property set to "No", the user can add a value which doesn't exist in the previously stored values.

Alternatively, set that property to "Yes" and write VBA code for the combo's "On Not in list" event.

Either way, you should have an index on YourField. You can .Requery the combo's row source from the form's On Current event so that it "refreshes" to pick up the newest additions.