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
  • 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)
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.


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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Some sers suddenly getting error popup msg 28 85
sql help 8 55
Access Update Query 1 19
Connection to multiple databases 13 16
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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 …

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now