2 Access tables, count verbiage used

Posted on 2016-11-07
Last Modified: 2016-11-07
I have a table named Orders with field Product. In that field, there is string of text which contains the color of the product. In another table, I have field Color, which has all the possible colors that may be in the text string in the other table. I need to count the number of Products in table Orders that have the Color from the second table. Reason: I need to count how many orders used each possible Color. Ideally, I would add a field called Color in table Orders right after field Product which would store the color found in the other table.
Question by:QMBB
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
  • 3
  • 3
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41877711
first, you need to create a UDF to parse the content of the field Product to get all the colors for that record.
next is to compare the result to the values in the  second table.

a sample db is needed to do this.

upload a copy of the db with the two tables.

Author Comment

ID: 41877719
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41877744
the color field contains text that are not color, is this correct  (21 - 29 in)
Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.


Author Comment

ID: 41877754
Yes, 2 records, but I need to find those as well.
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 500 total points
ID: 41877773
test this revised db, I added a field color in table orders and populate by running the sub checkColors()

see code In module1  checkColors()

Author Closing Comment

ID: 41877794
Thanks very much.

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

688 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