List box with results from multi colums

  • Thread starter Thread starter lucky
  • Start date Start date
L

lucky

Guest
I have a table called contacts. This holds company names and contact names. i.e

Company Name
Contact 1
Contact 2
Contact 3

I have added mail merge functionality which all works for a single contact. I would like to show in a list box the contact names so you can pick one and this name will appear in the word document.

If I query against the company name you get the results but in a left to right list. I need them to appear underneath each other in a list box so you can choose one

Can anyone offer suggestions.
 
U could probably do that in code by grabbing each contact for that company and creating a value list for the listbox...

Do u have another table with company details or something that company name is related to?
If u do then i should point out that the way u have that table set up is not the best (in terms of a relational database that is).

U should just have something like:
compName
contactName
etc

so each company can have 0 contacts or they might have 3 or more contacts...
Then it would be a simple select query to grab the names for the listbox.
 

Users who are viewing this thread

Back
Top Bottom