473,382 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Selecting from a master table based on info in a detail table

While I'm sure this is simple I just can't figure it out.

Table A (assignments) is on the One side of a One to Many relationship
With Table B (assignees)There are many assignees assigned the one task.

I have the relationship set to Join all records in Table and only the
records in Table B that Match.

Currently I have a form that displays all of Table a's data. Using the
the OnEnter property of the AIKey's field I display Table B's data. Now
I want to display Table A's data for each AIKey that contains an given
assignee. In other words, If an assignee isn't included in the scope of
the assignment then I don't want that assignment included in table A's
records in the form.
Maybe a picture is better:
Table A Table B
AIKey (Primary Key) AIKey
Assignment Assignee

Let's assume The data looks like this:

Table A Table B
AIKey Task AI Key Assignee
__________________________________________________ _
04-1 Sweep Floors 04-2 God
04-2 Create World Peace 04-1 God
04-3 Photo Op 04-2 George Bush
04-3 George Bush
04-3 Mortal
If the Variable is "Mortal" the Output would be:
04-3 Photo Op

If the Variable is "God" the Output would be:
04-2 Create World Peace
04-1 Sweep Floors

If the Variable is "George Bush" the Output would be:
04-2 Create World Peace
04-3 Photo Op

Any Help would be appreciated!
Chris
Nov 13 '05 #1
2 1541
Hi Chris,

It looks like you want the named Assignee to be in the criteria for field
Assignee:

Where Assignee like "Rusty Jones"

HTH
--
-Larry-
--

"Chris Belcher" <ch******@bellsouth.net> wrote in message
news:Q5******************@bignews2.bellsouth.net.. .
While I'm sure this is simple I just can't figure it out.

Table A (assignments) is on the One side of a One to Many relationship
With Table B (assignees)There are many assignees assigned the one task.

I have the relationship set to Join all records in Table and only the
records in Table B that Match.

Currently I have a form that displays all of Table a's data. Using the
the OnEnter property of the AIKey's field I display Table B's data. Now
I want to display Table A's data for each AIKey that contains an given
assignee. In other words, If an assignee isn't included in the scope of
the assignment then I don't want that assignment included in table A's
records in the form.
Maybe a picture is better:
Table A Table B
AIKey (Primary Key) AIKey
Assignment Assignee

Let's assume The data looks like this:

Table A Table B
AIKey Task AI Key Assignee
__________________________________________________ _
04-1 Sweep Floors 04-2 God
04-2 Create World Peace 04-1 God
04-3 Photo Op 04-2 George Bush
04-3 George Bush
04-3 Mortal
If the Variable is "Mortal" the Output would be:
04-3 Photo Op

If the Variable is "God" the Output would be:
04-2 Create World Peace
04-1 Sweep Floors

If the Variable is "George Bush" the Output would be:
04-2 Create World Peace
04-3 Photo Op

Any Help would be appreciated!
Chris

Nov 13 '05 #2
Larry Daugherty wrote:
Hi Chris,

It looks like you want the named Assignee to be in the criteria for field
Assignee:

Where Assignee like "Rusty Jones"

HTH

Larry... I had tried WHERE, but not in combination with a DISTINCT...
Sometimes ya just need a Kick to get your attention. Thanks!
Chris

This Works!
SELECT DISTINCT [AI Master].[AI Key], [AI Master].[AI Title]
FROM [AI Master] LEFT JOIN [AI Detail] ON [AI Master].[AI Key] = [AI
Detail].[AI Key]
WHERE ((([AI Detail].[Assignee Short])="RS"));

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mark | last post by:
Hello, We currently have a table (access 2000) that has the following values: 706 6789 1 5.11 N N 20040923 792 6592 1 10.05 N N 20040923 795 1605 1 6.30 N N 20040923 807 5817 1 6.33 N N...
3
by: bitoulis | last post by:
Hi, is it possible to use the records of a table as the field names of another table? If yes, how is it done? Thanks in advance Laertes
1
by: bastos.sergio | last post by:
Hello everyone, I'm having a bit of a problem seeying the big picture in this and I was hoping somebody more experienced in this could help tell me if I'm proceding right. I plan to construct a...
0
by: Leonardo Gangemi | last post by:
How to align right a table based on another table created dinamically? Leonardo
1
by: John | last post by:
Hi I have dragged a master and a detail table on the form. How can I now make the master table control the detail table in that proper detail records are displayed when a master record is...
3
by: turtle | last post by:
I have Two tables (Table1 and Table2). Both tables have a common field called part number. Table 1 contains an extra field that i would like to update table 2 to match if the part number matches....
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
3
by: Ronald S. Cook | last post by:
I have a table of keywords (hundreds/thousands of records): KeywordID KeywordName --------- ----------- 1 Apple 2 Orange 3 Pear I then have a table of...
1
by: Miley | last post by:
Hi everyone, This is my question/problem. I have a table with orders and a table with order details. Clients can order multiple products at once during one order, so one line has to be inserted...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.