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!

How to create a combo box with 1 column from 2 different columns?

Status
Not open for further replies.

Wokkel

Technical User
Aug 14, 2002
3
NL
Is it possible to create a combo box showing one column from two different rows of a table?
I have a table with an ID, home phone number and GSMnumber. I want to use the phone numbers in an other table by doing a lookup from a combo box. I want the numbers to be displayed in the combobox in one column, not in two.

I now have a combo box that shows two columns, the home phone number and next to it the GSMNumber. The SQL for this is:

SELECT DISTINCTROW [Phonenumbers].[id], [phonenumbers].[homephone],[phonenumbers].[GSM] FROM [phonenumbers]

Is it possible to show the one column with the home phone numbers as well as the GSM numbers?

The ID is used to refer to the person of whom the phone is.

If I am unclear about something please let me know.

Cheers,

Dennis Wokke
 
You don't need to use SQL. Simply consrtuct a query in the query grid, including all the related tables. Then add a field caled "LookUpData", or whatever. Folow this name with a colon and then concatenate the constituent fields using the "&" operator. You can also include spaces, punctuation. For example LookUp:[Name] & ", " & [TelNo] & " - GSM " & [GSM] will give you "Smith, 404 234 5681 - GSM 5654444". You can sort if you wish.
 
hi Mikey69,

Thanks for helping out on this one. It works fine now.

Dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top