473,651 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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)Ther e 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 1555
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******@bells outh.net> wrote in message
news:Q5******** **********@bign ews2.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)Ther e 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
3704
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 20040923 704 3222 1 10.05 N N 20040923 782 7833 2 9.40 N N 20040923
3
2462
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
2397
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 master invoice table with client information and a linked details invoice table with line items of all items charged. I also plan to have a payments table of the invoices. Since the client can make more than one payment to an invoice I need to...
0
257
by: Leonardo Gangemi | last post by:
How to align right a table based on another table created dinamically? Leonardo
1
974
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 selected from the Master BindingNavigator? Thanks Regards
3
8743
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. I created a join between Table1 and Table 2 but couldn't update Table 2 since the recordset was unupdateable. What i would like: Table 1 Part Number Field 2
7
4535
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 records. Should I design a new form for this or can I somehow make this work in the same form. Thanks in advance, john
3
2598
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 products (also hundreds/thousands of records):
1
2608
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 in the main order table, and multiple order details from the same order in the order detail table. How do I do this? Right now if a client orders 5 products during one order, the order detail table looks fine, but also get 5 records in my main...
0
8795
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8576
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.