473,398 Members | 2,404 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,398 software developers and data experts.

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 2056
What are the entities involved apple? Normally another entity is needed
between the relationship.

"Apple" <tt*********@yahoo.com.hk> wrote in message
news:55**************************@posting.google.c om...
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*********@yahoo.com.hk> wrote in message
news:55**************************@posting.google.c om...
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.com> wrote in message news:<Ub********************@comcast.com>...
"Apple" <tt*********@yahoo.com.hk> wrote in message
news:55**************************@posting.google.c om...
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&CarInfo Query
======================
CarInfo.CarNo
..OwnerNo
..Brand
..Model
..MemberNo
..StampExpDate
..OpenA/CDate
..CloseA/CDate
CarOwner.OwnerNo
..Name
..Tel

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

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

4. A Call Query will be created

Call Query
==========
Call.RecordNo
..CallNo
..CarNo
CarOwner&CarInfo.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.ReceiptNo
..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*********@yahoo.com.hk (Apple) wrote in
news:55**************************@posting.google.c om:

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&CarInfo Query

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

4. A Call Query will be created

Call Query
==========
Call.RecordNo
.CallNo
.CarNo
CarOwner&CarInfo.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.ReceiptNo
.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
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...
2
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...
2
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...
3
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...
13
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
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...
1
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...
11
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...
2
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...
6
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
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...
0
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 project—planning, coding, testing,...

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.