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

Putting a description by selections in combo box

Status
Not open for further replies.

dabowles

MIS
Jun 26, 2001
64
US
Hi,
How do you bind a combo box using SQL to not only show the possible selections from a form, but also to show a second field beside that that say, shows the description of the selection, however, I don't want it to save that second field to the field the combo box is bound to. I hope I have described myself clearly.

Thanks,
Dave
 
From your question, I believe that you want to have two fields show in the combo box, but only want the bound column (say the first) be saved in the table.

Create your SQL statement that returns both fields. In the property sheet of the combo box set the ColumnCount property to 2. In ColumnWidths property put .5"; 1.5". Set the BoundColumn to 1.

Run the form and you will see two fields: 1.Code; 2.Description. The saved value will be 1.Code

Hope that helps

Bob
 
If you want, you can just show the Description column by setting the width of column to 0". That way the user doesn't get confused by seeing the codes in the first column. Then again, if some of your users know the code better, just leave it and display both... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top