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

Combo box selection enter value from 2 columns

Status
Not open for further replies.

ali32j

Technical User
Apr 23, 2007
97
GB
Hi All

I have a form which uses a combo box (row source is a query) to select a contact. due to the nature of my contacts table the combo box lists 2 columns, one with first name and one with surname.

When using the wizard allows you to pick one column to automatically enter in to table record, but what i would like is to add first and last name in the same box, is this possible? and can anyone give me some guidance?

Thanks

Ali
 
Hi Ali,

You could join the fields together in your query and display that field in your combo box. I am assuming that you have a primary key that makes each record unique and that is what would be used to determine what record will be shown. In your query create something like:

CustomerName: [Surname Field] & ", " & [FirstName Field]

Change the field names to match what you have yours set too. This will take the surname Smith and the first name John and join them together so it will show Smith, John.

I hope this makes since!
Lena

Lena
**Using Access 97 at work**
**Using Access 2003 at home**
 
Hi elliefant

that worked well, did not think to approach in from within the query!

thanks again

Ali
 
You are very welcome. I am glad that I could be of help!

Lena

Lena
Using Access 2003
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top