Combo Box and Two Fields

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

Guest

To add a new record in a form, I am using a combo box to load a table from
another table. The table I am loading to has two fields that I’d like to load
with one combo box. I like to choose two fields in the combo box and load
both fields in the record I am creating.
 
To add a new record in a form, I am using a combo box to load
a table from another table. The table I am loading to has two
fields that I’d like to load with one combo box. I like to
choose two fields in the combo box and load both fields in the
record I am creating.
Give the combobox rowsource as many additional fields as you
want.Bind the controlsource of the combobox to the first column of
the table.
Make the control source of the additional fields =combobox.column
(n) where n is the zero-based index into the columns of the
combobox. This will show them on the form, but will not store the
additional columns in the table. They should not be stored
anyways, they should always be lookedup when you need them in a
form or report.
 
rap43 said:
To add a new record in a form, I am using a combo box to load a table from
another table. The table I am loading to has two fields that I’d like to load
with one combo box. I like to choose two fields in the combo box and load
both fields in the record I am creating.
You select a row in a combobox ... thus selecting a row does select both
of your fields. The bound column is the default value returned from the
combobox and can be refenced directly by just the combobox name. You
reference the fields of the selected row by referencing their column
(which is zero based). YourComboboxName.Column(0) refernces the 1st
column. YourComboboxName.Column(1) references the 2nd column.
 
Back
Top