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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populate combo box question 1

Status
Not open for further replies.
Jul 8, 2002
61
0
0
US
Hi,

I have a subform (datasheet view) that is tied to a table. In the subform there is a 'combo box' field called "Status." Status is tied to the column "status" in the table. The dropdown is populated with a query "select Status_Name from tbl_status;" Here is what tbl_status looks like:

Status_ID Status_Name
0 OK
1 Duplicate
2 Unknown

My problem is I want the dropdown to display the Status_Name (easier for users), but I want to update the table with Status_ID.

Is there a way to show the status_name in the dropdown, but have the "control source" property tied to the Status_ID? Thanks for the help!

Andrew
 
Set the column width for the first column to zero but make sure the control is still bound to column one.

What the end user will now see is the value of the column two field but your data will be the value in column one.

Steve
 
Thanks for your help,

where do I set the column width? I've created a query that selects status_id, status_name from tbl_status, I ran the query and for the field status_id I dragged the sizing handle all the way to the left so that you couldn't see that field anymore (does my explanation makes sense?).

I set the "row source" property of the drop down to my query, and set the "bound column" to 1 (the ID field). I view the form and it's still the ID that are populating the dropdown, not the names. Is that what you meant to do? Maybe I'm not setting the column width correctly....

Thanks again for your help,

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top