Combo Box to display ID's used only

Posted on 2012-03-12
Medium Priority
Last Modified: 2012-03-12
I am trying to create a combo box that will only display the ID's that have been used on the master table. I have one table called customer type that gives a unique key and description for customer types. When the master table is populated with customers the users choose from a drop down list that is populated with the unique ID and description from the Customer Type table.

Now I am in the process of creating a multi-parameter query that will display customers based on what the user chooses from multiple combo boxes on a form. The challenge I am running into is there are some customer types that have not been used yet. I need that customer type combo box to only show the ones that have been used on the master table, not all of them from the Customer Type table.

I have searched and searched this board, in fact I have spent the last couple hours doing so, trying to find my answer and keep coming up empty. It is probably in how I am doing my search of the board, but I have tried several combinations of words and still cannot seem to find the answer. I know it is probably something simple but it is costing me a lot of time to find it.

Question by:caseyu
  • 4
  • 3

Expert Comment

ID: 37711379
Can you share the query and the tables layouts?

Expert Comment

ID: 37711389
If your query has a join between the 2 tables,  only the ones that are on both will be included
LVL 42

Assisted Solution

dqmq earned 500 total points
ID: 37711398
Make the rowsource for your combobox like this:

Select t.* from CustomerType as T inner join MasterTable as M on M.CustomerTypeID = t.CustomerTypeID

Of course, you need to substitute your table and column names
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.


Author Comment

ID: 37711445
I have been accused of this before and a lot of the time it is true since I am not always 100% sure how to ask for what I want, but I might not have been very clear. On the combo box for the multi parameter query, I only want the Customer Type (cTypeID) to show up once if it exists on the Master table. Below is the copy of the code that I entered in the row source. I got it to give me a list but it is giving me the cTypeID for every customer that is in the master table, not limiting it to 1 if it exists on the table.

Author Comment

ID: 37711450
SELECT t.* FROM tblTypes AS T INNER JOIN tblContact_Primary AS M ON M.cTypeID = t.cTypeID;

Expert Comment

ID: 37711496
try select distinct only selecting Cust type, not *

Accepted Solution

gnetgnet earned 500 total points
ID: 37711598
SELECT DISTINCT t.cTypeID FROM tblTypes AS T INNER JOIN tblContact_Primary AS M ON M.cTypeID =  t.cTypeID;

Author Comment

ID: 37711646
GNET got me the final answer but both helped out so I am splitting the points.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Audit trails are very important in any system to hold people responsible for certain transactions and hold them to take ownership of their actions. This article is dedicated to all novice "Microsoft Access" developers.
What to do if a split doesn't fit? Or a bunch of invoice lines must be rounded while the sum must match a total? It takes a little, but - when done - it is extremely easy to implement.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question