AUTO FILL?

  • Thread starter Thread starter GUS BURTON
  • Start date Start date
G

GUS BURTON

I have a simple database set up where I keep track of
inventory. On a form, I have these fields: Part Number,
Description, Date, and Price. How do I set it up where
when I enter a part number, the description box fills in
automatically with the corresponding description.

Any help would be greatly appreciated.

Thank You.

GB
 
"GUS BURTON" said:
I have a simple database set up where I keep track of
inventory. On a form, I have these fields: Part Number,
Description, Date, and Price. How do I set it up where
when I enter a part number, the description box fills in
automatically with the corresponding description.

Any help would be greatly appreciated.

Thank You.

GB

GB

The best way of doing this would be to use a combo box to allow the user to
select the Part Number. Assuming that the table that the part numbers are
stored in has at least these three fields:

PartID - AutoNumber (Primary Key for the table)
PartNumber - The part number as viewed by the user
PartDescription - The description of the part

Add a combo box to the form, and ensure that these three fields are in the
RowSource for the combo box. Set the column Widths of the combo box to:

0;3cm;0

or something similar, so that the first column (containing the primary key) and
the last column (containing the description) are hidden. You can then set the
control source of a text box to read this third column:

=cboName.Column(2)

Note that as columns in a combo box are 0-indexed, the third column has a value
of 2.
 
I have a simple database set up where I keep track of
inventory. On a form, I have these fields: Part Number,
Description, Date, and Price. How do I set it up where
when I enter a part number, the description box fills in
automatically with the corresponding description.

Any help would be greatly appreciated.

Thank You.

GB

The simplest way to do this is to use a Combo Box based on the parts
table; include the Description in the query upon which the combo is
based. Put a textbox on your form with a Control Source of

=comboboxname.Column(1)

The Column property is zero based so this will contain the SECOND
column (the description).

If you're trying to store the description redundantly in a second
table... DON'T. It's neither necessary nor good design to do so!
 
Back
Top