Company name look up

lsearcey

Board Regular
Joined
Sep 8, 2003
Messages
139
Is it possible to us a Query that a company name can be entered to look up names of companies and group them together.

Thank you
 

Some videos you may like

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

nullZero

Active Member
Joined
Nov 14, 2005
Messages
497
Can you provide a little more info as to what you're trying to do?
 

lsearcey

Board Regular
Joined
Sep 8, 2003
Messages
139
I have a customer database that has several fields like name address and phone number. It also has a combo box field that holds the name of the company they work for. I want to make a query that I can type in the name of the company and list all the contacts that work for that company. Thanks for your help any advice would be appreciated
 

tafigueroa

Board Regular
Joined
Oct 13, 2004
Messages
69
Of course you can...

Just in the WHERE section of your query use below:

WHERE CompanyName = "MicroSoft" (Substitute the company name you would like to search for) You can use

WHERE CompanyName = [Enter company name:]

if you would like the query to prompt you every time it is run for a company name.
 

lsearcey

Board Regular
Joined
Sep 8, 2003
Messages
139

ADVERTISEMENT

Thanks, It asks for the company but when I type in a company name that I know is listed in the compny name field it won't list any names. The comapny name field is a combo box does that make a difference?

thank you
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
If the query is built on a combo box, it is very likely that the combo is storing an ID field and displaying a name. You need to rebuild the WHERE clause to use the ID field, not the name, and try again.

Denis
 

lsearcey

Board Regular
Joined
Sep 8, 2003
Messages
139

ADVERTISEMENT

How do I find out what the ID field is?

Thank You
 

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
In Design view, right-click the combo and select the Properties.
Go to the All tab, and scroll down to the series of rows that begins with Row Source.
First, check the Column Count. It is most likely 2 or more.
The Bound Column (this is the data that Access stores) will be 1, more often than not.
Now lok at the Row Source. Click the Builder (...) button in the Row Source line, to bring up the query grid. If Bound Column is 1, the first field in the grid is the one that you have to filter by. If it is 2, pick the second field, and so on. Close the grid but don't save.
To confirm which field the value is stored in, go to the top of the property list and check the Control Source.

Denis
 

lsearcey

Board Regular
Joined
Sep 8, 2003
Messages
139
On the Row Source line there is no (...) button only a drop down button. There is a (...) button on he control source line. Is that the one I'm supposed to go to?

Thank You
 

Watch MrExcel Video

Forum statistics

Threads
1,118,535
Messages
5,572,759
Members
412,482
Latest member
arooshrana2
Top