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

Selecting Values from a ListBox 1

Status
Not open for further replies.

MattJM

Programmer
Oct 16, 2001
6
GB
My problem is how to use a listbox that allows a user to select a name but then stores a number in the underlying table. For example, given a table containing 2 fields, a Supplier ID and a Supplier Name, I want to have a drop down box on a form that allows a user to select the Supplier by the name, and always displays the name on the form, but the information recorded on the table is the ID.

I have one form where this works but I can't reproduce it. The working drop down was created using the Form Wizard. The Supplier Table is connected to an Order table, and at first there was a lookup for the Supplier Name. The form was created, and afterwards the lookup was changed to fetch the ID but the Order form continued to look up and display the Name. Now the user can select the name and if you look at the table the relevant ID is stored.

How can I reproduce this in other forms?

Thanks in advance,
Matt
 
Matt,

This is very easy to do.

In your combo box, set the column width properties to 0;10 (10 is an example). This will hide the first (the ID column) of the combo box.

HTH

Craig
 
Fantastic!

Thanks a lot, that was driving me around the bend! It's always the little tricks that save sooo much time.

Thanks again!
Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top