Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Combo box displaying ID numbers not the desciption

Posted on 2014-02-09
9
Medium Priority
?
251 Views
Last Modified: 2014-02-19
Please see the code.  It is pulling the ID numbers not the description.  What do I need to change in this SQL statement.

SELECT DISTINCT [CG Info].Products, [CG Info].Products, [Forms]![Contact Form]![select] AS Expr1
FROM [CG Info]
WHERE ((([Forms]![Contact Form]![select]) Is Null Or ([Forms]![Contact Form]![select])=[Targeting]))
ORDER BY [CG Info].Products;

Open in new window

0
Comment
Question by:lehi52
[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
  • 6
  • 3
9 Comments
 
LVL 52

Expert Comment

by:Rgonzo1971
ID: 39846528
Hi,

You pull [CG Info].Products twice what is it?

Regards
0
 

Author Comment

by:lehi52
ID: 39846531
Its quite possible bad code.  Here is the sample database.  Look at the contact form. It is the top middle combo box.
1.accdb
0
 
LVL 52

Expert Comment

by:Rgonzo1971
ID: 39846606
HI,

pls try
SELECT DISTINCT products.Products, [Forms]![Contact Form]![select] AS Expr1
FROM products INNER JOIN (Targeting INNER JOIN [CG Info] ON Targeting.ID = [CG Info].Targeting) ON products.ID = [CG Info].Products
WHERE ((([Forms]![Contact Form]![select]) Is Null Or ([Forms]![Contact Form]![select])=[Targeting]![ID]));

Open in new window

Regards
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:lehi52
ID: 39847477
That works on the second box.  But once I made that change the third box doesnt work any longer.
0
 

Author Comment

by:lehi52
ID: 39847482
Here is the database.  See the third box not pulling the results now.
2.accdb
0
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 39847510
Hi,

like in the first a join was missing

SELECT [CG Info].ContactID, [CG Info].[Policy Name], [Forms]![Contact Form]![productselect] AS Expr1
FROM products INNER JOIN [CG Info] ON products.ID = [CG Info].Products
WHERE ((([Forms]![Contact Form]![productselect]) Is Null Or ([Forms]![Contact Form]![productselect])=[Products].[Products]))
ORDER BY [CG Info].[Policy Name];

Open in new window

Regards
3.accdb
0
 

Author Closing Comment

by:lehi52
ID: 39847647
Thank you.
0
 

Author Comment

by:lehi52
ID: 39848007
Now I changed something and I am having the issue again. I am sure it is a quick fix.  See the attached database.
0
 

Author Comment

by:lehi52
ID: 39848012
Ill post a new question about this.  I shouldnt add on to an already closed topic.  The issue is I changed the combo box so it doesnt show up on each tab.  Then I thought I used all the same criteria as the previous one and now it shows the id numbers on the last combo box.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 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