Linking a Combo Box to a Text Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created an Access database. Then, I created made a form to enter data into a table.

I have two tables:
Invoice
Supplier

I have one form:
frmInvoice

frmInvoice fills in the the Invoice Table. Supplier is a Look up table. On the Invoice form, I would like to select the Supplier ID (foreign key from Supplier) and have the Supplier Name automatically fill in.

I am new to Access and cannot figure out how to get this to work.

Thanks in Advance,
Elena
 
Normally, the supplier id would be hidden and the combo box would be set to
display the name. Essentially, the id is Access's name for the supplier and
the text name is the user's name for the supplier.

To do what you're asking, it would probably be simplest to place both values
in the combo box's Row Source. When you drop down the list, both columns
will show, but the item in the first visible column is the one that will
fill the combo box's text box portion. To also display the other column,
create a textbox and set its control source to

=cboMyCombo.Column(1)

The column number is zero based, so 0 is the first column, 1 the second,
etc.

If you would like to only show one column in the drop down and still do the
above, that will work also. In the combo box's Properties sheet, Format tab,
set the widths of the columns as desired. For the column you want to hide,
set the width to zero.
 
Back
Top