Lookup Field 2nd Column

R

Rose

When using a lookup field within a form to choose information within another
table, how do you have the ID be the bound field but show a second field in
the form for the user. For example. There is a table for Cities. The first
field is CityID (AutoNumber) and the second is the name of the City.
Currently if the user uses the lookup field in the clients form, they can see
City in the dropdown list but the CityID is what shows when you choose a
record. Any Ideas how to show City Name instead?
 
G

ghetto_banjo

here are the settings you need for your combo box:

in the properties, Data Tab:
Row Source needs to be returning (at least) both the CityID and
CityName.
Bound Column = Column of CityID (i am assuming this is column 1)

on the Format Tab:
Column Count = 2
Column Widths = make the first width 0" if you do NOT want to show
CityID (will still be stored/bound, just not displayed). second
column width can be the width of the combo box. example: 0";2"


That should do the trick.
 
S

Stefan Hoffmann

hi Rose,

When using a lookup field within a form to choose information within another
table, how do you have the ID be the bound field but show a second field in
the form for the user. For example. There is a table for Cities. The first
field is CityID (AutoNumber) and the second is the name of the City.
Set the following properties:

Page Data:
Control Source: <your field>
Row Source: SELECT CityID, CityName FROM Cities ORDER BY CityName;
Row Source Type: Table/Query
Bound Column: 1

Page Format:
Column Count: 2
Column Widths: 0cm;5cm

instead of centimeter use the appropriate measure.


mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Form help 4
dependent combo boxes 1
mailing label 2
I NEED HELP!!! 2
Combo Box Lookup ??? 1
Requery form record source 2
Combo Boxes 2
Null values and combo boxes--a problem 1

Top