combo box display column

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

Guest

I am using a combo box in a table. the field is coming from a seperate
table, which has medication ID (autonumber) and medication name. in the
current table, i have a column to select medication ID, however, i want to be
able to view the name, and when i select the medication name, have the
medication ID put into the field. how do i do this?

thanks
 
Hi, Russ.

The easiest way is to use the combo box wizard, select the ID and name
columns, tell the wizard to Hide the Key field and which field to store the
ID in. To toggle on the wizard, choose View, Toolbox if the Toolbox is not
active, and toggle the button with the wand and stars.

The key properties the wizard sets are:

RowSource SQL statement for the data
ControlSource Field in which to store the selection
BoundColumn Which column is stored
ColumnWidths How much room to use to display each column.

If a column is set at 0", it does not display at all. Also, what displays
in the combo box is the first non-zero-width column.

Hope that helps.
Sprinks
 
Hi Russ,

Seems I already answered this once today, you?

That combobox in a field in a table is a Lookup Field. Get rid of it in
your table. They are thingies that MS Access group should never have
created. They violate the Relational
Rule that states that each field in a row must be "atomic". That is, the
field must address a single attribute of the entity and must not be the
result of calculations on any other values in the database.

You're much better off to never use them. Design your tables properly to at
least 3rd normal form and then you can safely build on them. If you do use
them they'll continue to give you troubles.

HTH
 
Back
Top