Solved

Combo Box to display ID's used only

Posted on 2012-03-12
8
224 Views
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.

Thanks,
0
Comment
Question by:caseyu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 

Expert Comment

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

Expert Comment

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

Assisted Solution

by:dqmq
dqmq earned 125 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
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:caseyu
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.
0
 

Author Comment

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

Expert Comment

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

Accepted Solution

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

Author Comment

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

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

729 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