automatic filling

  • Thread starter Thread starter Francisco
  • Start date Start date
F

Francisco

First time user, that has a learned plenty from trial by
error, but today I need to know this:
I want a field to automatically fill itself out after a
entered a code. EX:
When i enter [Job Number]1083 I want that the field [job
location]houston be filled automatically.

Thanks in advance
 
Francisco said:
First time user, that has a learned plenty from trial by
error, but today I need to know this:
I want a field to automatically fill itself out after a
entered a code. EX:
When i enter [Job Number]1083 I want that the field [job
location]houston be filled automatically.

Thanks in advance

There are two ways to go about this. One is to use a combo box for the
Job Number, and have the lookup value Job Location as the second column
of the combo box. Then have a text box for displaying Job Location set
to an expression that simply reads the second column of the combo box,
like this:

=[JobNumber].[Column](1)

Note that, in an expression like this, the columns of the combo box are
zero-based, so column1 is the second column.

The second way is to use what's called an "autolookup query" as the
recordsource of your form. In such a query, you have both the original
recordsource table and the lookup table (the one for which JobNumber is
the primary key), and the tables are joined on the JobNumber field they
have in common. The query also includes the field you want to look
up -- in this case, JobLocation -- from the lookup table. Then you can
bind a text box directly to the JobLocation field. This text box will
then be updatable, unless you lock it.
 
Back
Top