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
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?
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.
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.