Combo-box lookup shows wrong value after user makes selection

  • Thread starter Thread starter cjborntorun
  • Start date Start date
C

cjborntorun

I have a sub-form that requires the user to select a "ServiceID" in a
combo-box. The related table has "ServiceID" and "ServiceDescription".
These are the only 2 columns in the table, nothing else.

When the user selects the ServiceID, I want my combo box to show the
ServiceDescription on the form, but it shows the ServiceID instead.

Strangely, when I look at the underlying table where the selections are
ultimately stored, it CORRECTLY displays ServiceDescription. How can I get
that to appear on the form too as the user makes their selections.

Thanks
 
Two issues ...

First, if looking at "the underlying table" reveals the [ServiceDescription]
instead of the [ServiceID], then that table is using the lookup datatype.
This datatype displays one thing (a looked-up value), but actually STORES
something else (the primary key value). As you can imagine (oops, you don't
have to imagine!), this causes confusion.

Second, if your form's combobox looks up the ID & Description, but displays
the ID, it's because your combobox's properties are set to display the first
non-zero-width field from the lookup ... ?! guess which one that is ?! You
can fix that by setting the width of the first (?[ServiceID]?) field to 0.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Open form in design view, click on the combo, double click, select
Properties. Scroll to the Column Count and set to 2. Scroll to Column Widths
and change to 0"; 1.5" or as wide as necessary to display the
ServiceDescription.
 
Back
Top