Combo boxes - values and titles

AvalonMel

New member
Local time
Today, 18:10
Joined
Jul 31, 2006
Messages
5
I have a form that includes a field for the operating system of the client. I want this to be populated from a look-up table. I want the combo box to display the text name of the OS but enter the numerical ID number to the client table. How do I do this?
 
Setup the correct relationships between the client table and the lookup table. Use the wizard to create the Combo Box and voila it will work!

HTH :-)
 
when you select the columns in a combo box wizard, select the numeric code as the first column, and the text description as the second. Make the width of the first column zero. (the wizard recommends this)

the combo box then stores the value of the first (hidden) column, but displays the value in the second (non-zero width) column, which is what you want.

access actually displays the data taken from the first non-zero width column.
 
And just for additional learning information -

You can set the rowsource to the combo box easily by clicking the elipsis next to rowsource in the properties dialog. You can then, in the properties window as well, set the number of columns to be included (if you set the query but don't set the number of columns, the default is 1) and then the width of the columns. Setting the width is where you can have a column included in the combo box (and listbox) but not show it. So, if you set the key to not show by using 0" in the width and then set the BOUND COLUMN to be that column (it can be something other than the first column, but traditionally you set your query to have the key as the first column).

---and Gemma beat me to it as I took too long to type ---- :D
 

Users who are viewing this thread

Back
Top Bottom