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

Multi Field Combo Box

Status
Not open for further replies.

wxkeep

Programmer
Jul 5, 2005
57
US
This will probably seem really easy, but for some reason I can't even come close to developing and idea for how to make this work.

I have a database of people, named tblPeople, with about 20 fields. Among these fields are: First, Middle, and Last. Which, obviously, are meant to hold the First, Middle, and Last name of the customer respectively.

I am designing a form where the user will select one of these customers, and after update of the combobox - display all the information, the other 16 fields (one field is the primary key) on the form. I have that worked out but I cannot seem to populate my combobox correctly.

When the user scrolls through the combo box I want it to appear as if their choices are the whole name of the customer. I.E. It would look like Mikey T Mouse was an option in the box. The problem is that if I change the number of columns I get something like:

001 | Sales | Mikey | T | Mouse

so it includes the first few fields - which I don't want, and lines between the fields - which I really don't want. I want it just have their name, and then it would (behind the scenes to the user) use the customer id key to reference the other information as neccessary. Any suggestions as to how to achieve this? Thanks in advance for all of your help!
 
Hi
Maybe:
[tt]RowSource: Select tblPeople.ID, tblPeople.Dept, tblPeople.First & " " & tblPeople.Middle & " " & tblPeople.Last From tblPeople[/tt]
[ponder]
 
Well, that comes close. It does allow me to only pull the information needed. The id, the first name, the middle name, and the last name. But when I drop the box down there is still the dividing line between all of the names so it looks like this:

1 | Mickey | T | Mouse
2 | Howard | The | Duck
3 | Bo | Alan | Johnson

instead of:

Mickey T Mouse
Howard The Duck
Bo Alan Johnson


secondly when I select a record it puts only the first field in the display box.

i.e. it says 1 instead of Mickey T Mouse.

Any ideas?
 
Hi
I find the dividing lines strange.
Can you try:
[tt]RowSource: Select tblPeople.ID, tblPeople.First & " " & tblPeople.Middle & " " & tblPeople.Last From tblPeople
Column Count: 2
Column Widths: 0,2[/tt]

This should show the data as you wish, I hope.

 
You are a genius!! Thank you very much - that was exactly what I was looking for!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top