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!

Combo box problem

Status
Not open for further replies.

rvmams

Technical User
Jan 28, 2003
22
0
0
GB
Very newbie question: I am trying to create a form which would allow me to view company names, addresses and telephone numbers.

At the top of this form I would like to include a combo box, which would help to browse through the already existing records.

Problem is: although I can create a combo box, which lists all the existing companies, the combo box list gets updated with the primary key (automatically) instead of the name, when I select a record (even if I do not edit the name of the company). I am sure it is an incredibly simple error. But I have been struggling with this for a while now... Does any one know what I am doing wrong?

Thanks,

RvMamS
 
If I understand correctly, you are seeing the primary key value in the combo box? What you really want to see is the company name?

Go into the form design and open the properties for the combo box. The row source will read somthing like:

SELECT yourtable.primarykey, yourtable.companyname FROM yourtable

There should also be a Column width property.. if you set this to 0; 2 this is telling the database to hide the first column (which contains the primary key) and show the second column (which is the company name) according to the SELECT statement...


Does this help?
 
Thanks for your help! It worked!!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top