473,659 Members | 3,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

many to many relationship

I have to create a query with many to many relationship, but I can't
break it into 2 x 1 to many, should there anyone can teach me how to
solve this problem. Thanks in advance!
Nov 13 '05 #1
4 2067
What are the entities involved apple? Normally another entity is needed
between the relationship.

"Apple" <tt*********@ya hoo.com.hk> wrote in message
news:55******** *************** ***@posting.goo gle.com...
I have to create a query with many to many relationship, but I can't
break it into 2 x 1 to many, should there anyone can teach me how to
solve this problem. Thanks in advance!

Nov 13 '05 #2

"Apple" <tt*********@ya hoo.com.hk> wrote in message
news:55******** *************** ***@posting.goo gle.com...
I have to create a query with many to many relationship, but I can't
break it into 2 x 1 to many, should there anyone can teach me how to
solve this problem. Thanks in advance!


Apple,

Can you please explain why you can't use two "one to many"
relationships to express a many to many relationship?
Sincerely,

Chris O.
Nov 13 '05 #3
"Chris2" <ra************ ******@GETRIDOF .luminousrain.c om> wrote in message news:<Ub******* *************@c omcast.com>...
"Apple" <tt*********@ya hoo.com.hk> wrote in message
news:55******** *************** ***@posting.goo gle.com...
I have to create a query with many to many relationship, but I can't
break it into 2 x 1 to many, should there anyone can teach me how to
solve this problem. Thanks in advance!


Apple,

Can you please explain why you can't use two "one to many"
relationships to express a many to many relationship?
Sincerely,

Chris O.

Thank you Chris, I believe my table is not sturcture good. Please Let
me show you my table structure and hope you can give me some advise.

1. I will make 2 tables as :
tblCarOwner ( PK - Primary key)
===========
OwnerNo - text (PK)
Name - text
IDNo - text
Birthday - date
Sex - text
Tel - text
Add - text

tblCarInfo
==========
CarNo - text (PK)
OwnerNO - text (Combo box)
Brand - text
Model - text
MemberNo - text
StampNo - text
StampExpDate - date
OpenA/CDate - date
CloseA/CDate - date

2. I will join the tables CarOwner & CarInfo as

CarOwner&CarInf o Query
=============== =======
CarInfo.CarNo
..OwnerNo
..Brand
..Model
..MemberNo
..StampExpDate
..OpenA/CDate
..CloseA/CDate
CarOwner.OwnerN o
..Name
..Tel

'3. I will make a table to join the CarOwner&CarInf o Query

tbl.Call
========
RecordNo - AutoNo (PK)
CallNo - text
CarNo - text

4. A Call Query will be created

Call Query
==========
Call.RecordNo
..CallNo
..CarNo
CarOwner&CarInf o.OwnerNo
..Name
..Tel
..Brand
..Model
..MemberNo
..StampNo
..StampExpDate
..OpenA/CDate
..CloseA/CDate (expression : is Null)

5. Finally, I will create table Receipt to join the Call query

tblReceipt
==========
ReceiptNo- Auto (PK)
CallNo - text
PaymentMethod - text

6. Join table Receipt with Call Query

Receipt Query
=============
Receipt.Receipt No
..CallNo
..PaymentMethod
Call Query.OwnerNo
..Name
..CarNo

The problem is :
1. when I use CallNo in table receipt as PK, it's not allow me to
charge the same CallNo more than once.
2. when I use ReceiptNo in table receipt as PK, it's can't append
record, I think the reason is the join fields not the PK.

I hope I describe my suituation well to let you understand, please
teach me what shall I do. Thanks in advance.
P.S. The CallNo. must be reused after the job completed.

Sincerely,
Apple
Nov 13 '05 #4
tt*********@yah oo.com.hk (Apple) wrote in
news:55******** *************** ***@posting.goo gle.com:

Can you please explain why you can't use two "one to many"
relationships to express a many to many relationship?
Sincerely,

Chris O.

Thank you Chris, I believe my table is not sturcture good.
Please Let me show you my table structure and hope you can
give me some advise.


[snip]

so far, good.
'3. I will make a table to join the CarOwner&CarInf o Query

tbl.Call
========
RecordNo - AutoNo (PK)
CallNo - text
CarNo - text

4. A Call Query will be created

Call Query
==========
Call.RecordNo
.CallNo
.CarNo
CarOwner&CarInf o.OwnerNo
.Name
.Tel
.Brand
.Model
.MemberNo
.StampNo
.StampExpDate
.OpenA/CDate
.CloseA/CDate (expression : is Null)
You should have Call.RecordNo in this query.

5. Finally, I will create table Receipt to join the Call query

tblReceipt
==========
ReceiptNo- Auto (PK)
CallNo - text
PaymentMethod - text
the receipt needs Call.RecordNo to store that value as its
foreign key.
6. Join table Receipt with Call Query

Receipt Query
=============
Receipt.Receipt No
.CallNo
.PaymentMethod
Call Query.OwnerNo
.Name
.CarNo
the receipt needs Call.RecordNo to store that value as its
foreign key.

The problem is :
1. when I use CallNo in table receipt as PK, it's not allow me
to charge the same CallNo more than once.
that's because you need to store Call.RecordNo as the key.
2. when I use ReceiptNo in table receipt as PK, it's can't
append record, I think the reason is the join fields not the
PK.
No I suspect that the use of the wrong key gives a result where
Access can't decide which Receipt is the valid one, because you
have a bad PK there.

I hope I describe my suituation well to let you understand,
please teach me what shall I do. Thanks in advance.
P.S. The CallNo. must be reused after the job completed.

Sincerely,
Apple


Good luck

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #5

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

Similar topics

2
908
by: Keith | last post by:
I am having a problem creating a many-to-many-to-many type relationship. It works fine, but when I create a view to query it and test it, it does not generate the results I expected. Below if the DDL for the tables and the SQL for the view.
2
3413
by: Larry R Harrison Jr | last post by:
I have an Access 97 database with 2 tables that have a one-many relationship. I have a SQL statement in the "one" table which I want to execute and insert 7 records into the "many" table, and I want them to be linked to the "main" table. Problem is, it won't let me run the SQL run as long as the one-many relationship is established in the relationship window. The SQL is:
2
2688
by: Megan | last post by:
hello everybody, i know this is a very long post, but i wanted to provide as much detail as possible. quick overview- i want to create a couple of many to many relationships and am wondering how many relationships to create. i am also trying to figure out what relationships to create.
3
7387
by: lorirobn | last post by:
Hello, I have a report which uses a subreport. When I run the report, I get "Enter Parameter Value" error message for "tblGuestRoom". I click ok and the report seems to work fine. I narrowed down this error to the Link Master Fields property setting, when I tried the same scenario with form/subform. It gave me error: 'The Link Master fields property setting has produced this error: The object doesn't contain the Automation object...
13
1879
by: the other john | last post by:
The trouble currently with 3 tables. I'm excluding non-relevant fields... tbl_users PK_user_ID tbl_developers PK_developer_ID FK_developer_user_ID FK_developer_project_ID
5
2980
by: Robert | last post by:
I am very new to .net and asp.net. I am trying to design an intranet page that has a SQL Server 2000 database. I understand how to connect to the data but am getting very confused on how to display, update and modify data in a one to many relationship. Is there any resource available that can show me how a web form looks when the data is in a one to many relationship. I've done work in MS Access and it was very easy using sub forms...
1
2472
by: Michael D. Reed | last post by:
I have two tables in an Access database with a Many-to-Many relationship, there is a connection table. The tables are , , and the connection table is this is a standard Many-to-Many relationship in that the connect table only has two foreign key columns one for each of the other table primary keys, a very straightforward setup. The above is setup in a data set in a Data Set called “ProductDataSet” in a C# program. I have a record...
11
10614
by: RobertJohn | last post by:
Hi all I am using Access 2007 to start a small home library application, and so far it has two tables. 1. Books, with fields Book_ID (Primary Key) and Title, and 2. Authors, with fields Author_ID (Primary Key), First_Name and Last_Name. Both tables will be expanded later, after I have solved my current problem Because one book can have multiple authors, and because one author can have several books, I want to use a many-to-many...
2
2539
by: paulcjcross | last post by:
How to set up a many to many relationship. I know you need a third table to join the other two. I need one table (table1) with stock_numbers(unique), one table (table2) with job-numbers(unique) and I want to join them with a table (table3) with job-number linked with a stock-number and the number-of-units-of-that-stock. how is it done? so that the relationship window shows up: table1 many to one table3 and table2 many to one table3
6
4052
by: NicoleCartrette | last post by:
Going back to school is easier said than done.. This was posted to an older thread earlier but I don't think it got any attention. Your help is appreciated Professor requires we create a simple database and specified what are to be the primary keys and relationships etc. I have created the four tables and established the neccessary one to many and many to one relationships between primary keys in the tables with the exception of one...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8337
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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
8748
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...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8628
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
7359
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4175
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
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.