Getting a combo box to show a descrion, but enter an associted codeID into control source

S

Spidey3721

I have a form used for entering in different material selections for many
different condo units, which includes a combobox, [Light Fixture Combo] that
I want to use to record which light fixture goes into each unit (record)

I want the combobox to display the actual description of the fixture (from
the Light Fixtures table), but I want it to actually enter in the
appropriate FixtureID into the Owner Selection table - I do NOT want the
user to need to know, or even see the FixtureID's...

tbl Light Fixtures
FixtureID (Primary Key)
Fixture Name
Fixture Description
etc....
end tbl

tbl Owner Selections
UnitID (foreign key to 'Project info' table
FxitureID (foreign key to
LightCost
 
A

Allan Bach

If you use the combo box wizard, it will accomplish exactly what you desire. Just enter the fixture number in the FixtureID field (this should be a text data type). The wizard will hide the primary key in the combo box, allowing only the description (or whatever field you use) to show.

Allan
 
C

Carlos Alberto-Brasil

Try a DLookup Command. See a full description with examples by
looking up Microsoft Knowledge Base # 136122

Carlos Alberto-Brasil
 
R

Robert

In your combo box properties, make sure your row source includes to columns.
Set the width of the first column (the ID column) to 0, and set the bound
column = 1. Set the width of the second column (the description) = 1.25, or
however wide you want it. This will display the description to choose from,
but it will save the ID value in the database.

Robert Smith
Kaizen Software Solutions
http://www.kzsoftware.com/services/msaccess
 

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

Top