Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box

Status
Not open for further replies.

sfilipowicz

Programmer
May 8, 2007
9
NL
Hello,

In a form I have put a Combo Box which is populated from a table (Table name : category).

In the table category I have 2 columns : id, name

Now, the Combo Box shows the id's. I want the have the 'name' in the Combo Box and save the id's.

How would I do this?

Thanks for any help!!
 
The id should be the bound column with a 0 width.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi,

Thanks for the answer, but I do not really understand.

In the properties of the Combo Box I have :
Control Source : articles_category
Row Source Type : Table/Query
Row Source : categories
Bound Column : 1

This is the categories table :

id | category
-------------
1 | Tables
2 | Chairs
3 | Sofas


I want to display the text Tables, Chairs and Sofas in the Combo Box in the form, but I want the id number to be entered into the database.

Now I only see the id's in the ComboBox.


Thanks!!
 
Ok, I have found it.

I set the fields :
Column Count : 2
Column Width : 0";1"
Bound Column : 1


I do not really understand the value of Column Width (0";1").

But anyway, it works.

Steven
 
This means that the first column is displayed 0" for every 1" that the second column is displayed. That is, the first column is not displayed at all, and the second column is fully displayed, as desired.


-V
 
How are ya sfilipowicz . . .

Use the Combobox Wizard!

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top