Basic Question on Prefill

S

SITCFanTN

I have a form that I'm using for data entry for a group of people. One of my
fields is City. To ease the data entry process, when the user enters the
first letter of the city, I'd like the field to prefill as the user types so
they can just hit enter after entering a few characters of the city name.
I've seen this before but just can't seem to figure out how to add this
functionality. Any help you can give me is appreciated. Thank you
 
D

Dirk Goldgar

SITCFanTN said:
I have a form that I'm using for data entry for a group of people. One of
my
fields is City. To ease the data entry process, when the user enters the
first letter of the city, I'd like the field to prefill as the user types
so
they can just hit enter after entering a few characters of the city name.
I've seen this before but just can't seem to figure out how to add this
functionality. Any help you can give me is appreciated. Thank you


If you use a combo box for this field, the default AutoComplete option will
make it behave this way. If you have a separate table of cities, you can
use that table as the combo's RowSource. If not, you can base the combo on
a query that returns the distinct cities from your form's recordsource
table.
 
L

Linq Adams via AccessMonster.com

As Dirk said, in Access you can only reasonably do this using a combobox with
the AutoExpand Property set to Yes (which is the default.) Here's a step-by-
step:

You'll need a table with your cities listed. If you want the cities listed
alphabetically, make a simple query in Query Design View and under sort
select Ascending.

Add a combo box to your form. The Combobox Wizard will pop up

Select "I want combobox to look up values in a table/query."

Hit Next

Select Cities table or query

Hit Next

Click on the cities field to move it to the right side.

Hit Next x 2

Size the column appropriately.

Hit Next.

Select "Store that value in this field" and select the name of the field on
your form that will hold the City name


Name the combobox.

Hit Finish.

Now you can drop the combobox down and scroll down to the city or you can
start to enter the city name and the combobox will "autofill" as you type.
Hit <Enter> and the city will be entered into the appropriate textbox.
 
D

Dirk Goldgar

Linq Adams via AccessMonster.com said:
As Dirk said, in Access you can only reasonably do this using a combobox
with
the AutoExpand Property set to Yes (which is the default.)

AutoExpand! Yes, that's what I meant.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top